Hacky way to get VSCode to activate idris2-lsp.
-
Clone https://github.com/microsoft/vscode-extension-samples
-
cd vscode-extensions-samples/lsp-sample and follow the README
-
Apply the following diff adapting
serverModule
to your environment
--- a/lsp-sample/client/src/extension.ts
+++ b/lsp-sample/client/src/extension.ts
@@ -16,29 +16,19 @@ import {
let client: LanguageClient;
export function activate(context: ExtensionContext) {
- // The server is implemented in node
- let serverModule = context.asAbsolutePath(
- path.join('server', 'out', 'server.js')
- );
- // The debug options for the server
- // --inspect=6009: runs the server in Node's Inspector mode so VS Code can attach to the server for debugging
- let debugOptions = { execArgv: ['--nolazy', '--inspect=6009'] };
+ let serverModule = "/path/to/idris2-lsp/build/exec/idris2-lsp";
// If the extension is launched in debug mode then the debug server options are used
// Otherwise the run options are used
let serverOptions: ServerOptions = {
- run: { module: serverModule, transport: TransportKind.ipc },
- debug: {
- module: serverModule,
- transport: TransportKind.ipc,
- options: debugOptions
- }
+ run: { command: serverModule, },
+ debug: { command: serverModule, }
};
// Options to control the language client
let clientOptions: LanguageClientOptions = {
// Register the server for plain text documents
- documentSelector: [{ scheme: 'file', language: 'plaintext' }],
+ documentSelector: [{ scheme: 'file', language: 'idris' }],