Compiler in Rust (lexer, parser, checker, C codegen), maps, chars, dino fmt, dino lsp (diagnostics, formatting, outline, definition, hover, completion, signature help), docs, examples, VS Code/Vim files. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
27 lines
807 B
JavaScript
27 lines
807 B
JavaScript
// Starts `dino lsp` and connects the editor to it. All the work is done by the compiler.
|
|
const vscode = require('vscode');
|
|
const { LanguageClient } = require('vscode-languageclient/node');
|
|
|
|
let client;
|
|
|
|
function activate() {
|
|
const command = vscode.workspace.getConfiguration('dino').get('serverPath') || 'dino';
|
|
client = new LanguageClient(
|
|
'dino',
|
|
'Dino Language Server',
|
|
{ command, args: ['lsp'] },
|
|
{ documentSelector: [{ scheme: 'file', language: 'dino' }] }
|
|
);
|
|
client.start().catch((err) => {
|
|
vscode.window.showErrorMessage(
|
|
`Could not start "${command} lsp": ${err.message}. Put the dino program on your PATH or set "dino.serverPath".`
|
|
);
|
|
});
|
|
}
|
|
|
|
function deactivate() {
|
|
return client ? client.stop() : undefined;
|
|
}
|
|
|
|
module.exports = { activate, deactivate };
|