Dino compiler: language, formatter, language server, docs, editor support
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>
This commit is contained in:
1 parent
3e2779f447
commit
eaf9567a36
117 files changed
+19970
No files matched your search
@@ -0,0 +1,26 @@
|
||||
// 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 };
|
||||
Reference in new issue
Block a user