diff --git a/vscode-extension/server/src/server.ts b/vscode-extension/server/src/server.ts index 194b35e..1df7086 100644 --- a/vscode-extension/server/src/server.ts +++ b/vscode-extension/server/src/server.ts @@ -11,6 +11,8 @@ import { ProposedFeatures, CompletionItemKind, } from 'vscode-languageserver/node' +import { setGlobals } from '../../../src/parser/tokenizer' +import { globals } from '../../../src/prelude' const connection = createConnection(ProposedFeatures.all) const documents = new TextDocuments(TextDocument) @@ -31,10 +33,7 @@ connection.onRequest('shrimp/bytecode', handleBytecode) // Start listening connection.listen() -// ============================================================================ // Handler implementations -// ============================================================================ - function handleInitialize(): InitializeResult { connection.console.log('🦐 Server initialized with capabilities') const result: InitializeResult = { @@ -85,6 +84,7 @@ function handleParseTree(params: { uri: string }) { if (!document) return 'Document not found' const text = document.getText() + setGlobals(Object.keys(globals)) const tree = parser.parse(text) const cursor = tree.cursor()