Forgot to set globals in server
This commit is contained in:
parent
afaedeea23
commit
1082cc1281
|
|
@ -11,6 +11,8 @@ import {
|
||||||
ProposedFeatures,
|
ProposedFeatures,
|
||||||
CompletionItemKind,
|
CompletionItemKind,
|
||||||
} from 'vscode-languageserver/node'
|
} from 'vscode-languageserver/node'
|
||||||
|
import { setGlobals } from '../../../src/parser/tokenizer'
|
||||||
|
import { globals } from '../../../src/prelude'
|
||||||
|
|
||||||
const connection = createConnection(ProposedFeatures.all)
|
const connection = createConnection(ProposedFeatures.all)
|
||||||
const documents = new TextDocuments(TextDocument)
|
const documents = new TextDocuments(TextDocument)
|
||||||
|
|
@ -31,10 +33,7 @@ connection.onRequest('shrimp/bytecode', handleBytecode)
|
||||||
// Start listening
|
// Start listening
|
||||||
connection.listen()
|
connection.listen()
|
||||||
|
|
||||||
// ============================================================================
|
|
||||||
// Handler implementations
|
// Handler implementations
|
||||||
// ============================================================================
|
|
||||||
|
|
||||||
function handleInitialize(): InitializeResult {
|
function handleInitialize(): InitializeResult {
|
||||||
connection.console.log('🦐 Server initialized with capabilities')
|
connection.console.log('🦐 Server initialized with capabilities')
|
||||||
const result: InitializeResult = {
|
const result: InitializeResult = {
|
||||||
|
|
@ -85,6 +84,7 @@ function handleParseTree(params: { uri: string }) {
|
||||||
if (!document) return 'Document not found'
|
if (!document) return 'Document not found'
|
||||||
|
|
||||||
const text = document.getText()
|
const text = document.getText()
|
||||||
|
setGlobals(Object.keys(globals))
|
||||||
const tree = parser.parse(text)
|
const tree = parser.parse(text)
|
||||||
const cursor = tree.cursor()
|
const cursor = tree.cursor()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user