From 413a2f80c498bdd0c3d6b936cc70676cd9d2bf9c Mon Sep 17 00:00:00 2001 From: Ziwei Wang Date: Fri, 1 Dec 2023 11:03:27 -0500 Subject: [PATCH] Chore: Trigger the analyze when the scan completes --- server/src/server.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/server/src/server.ts b/server/src/server.ts index 0ee7d9a5..18836c71 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -39,6 +39,13 @@ let parseOnSave = true const disposables: Disposable[] = [] +let currentActiveTextDocument: TextDocument = TextDocument.create( + 'file://dummy_uri', + 'bitbake', + 0, + '' +) + connection.onInitialize(async (params: InitializeParams): Promise => { logger.level = 'debug' logger.info('[onInitialize] Initializing connection') @@ -57,6 +64,11 @@ connection.onInitialize(async (params: InitializeParams): Promise { + logger.debug('[On scanReady] Analyzing the current document again...') + void analyzer.analyze({ document: currentActiveTextDocument, uri: currentActiveTextDocument.uri }) + }) + return { capabilities: { textDocumentSync: TextDocumentSyncKind.Incremental, @@ -140,6 +152,8 @@ documents.onDidChangeContent(async (event) => { void connection.sendDiagnostics({ uri: textDocument.uri, diagnostics }) } + currentActiveTextDocument = textDocument + // Other language extensions might also associate .conf files with their langauge modes if (textDocument.uri.endsWith('.conf')) { logger.debug('verifyConfigurationFileAssociation')