From ece8e93aa3fdc791f43b0692607f8f6ae2d53f70 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')