From 73ce5a141254118d4cbe549f63025af7eb5ea2dc Mon Sep 17 00:00:00 2001 From: Nacho Cordon Date: Sun, 22 Dec 2024 19:18:24 +0100 Subject: [PATCH] Improves the events to relint documents --- packages/language-server/src/server.ts | 2 +- packages/schema-poller/src/metadataPoller.ts | 4 ++-- packages/schema-poller/src/schemaPoller.ts | 2 +- .../vscode-extension/tests/specs/api/autoCompletion.spec.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/language-server/src/server.ts b/packages/language-server/src/server.ts index 990cea14..c0a43a97 100644 --- a/packages/language-server/src/server.ts +++ b/packages/language-server/src/server.ts @@ -105,7 +105,7 @@ connection.onNotification( 'connectionUpdated', (connectionSettings: Neo4jSettings) => { changeConnection(connectionSettings); - neo4jSchemaPoller.events.on('connectionConnected', relintAllDocuments); + neo4jSchemaPoller.events.once('schemaFetched', relintAllDocuments); }, ); diff --git a/packages/schema-poller/src/metadataPoller.ts b/packages/schema-poller/src/metadataPoller.ts index 37d39f1c..4857a50d 100644 --- a/packages/schema-poller/src/metadataPoller.ts +++ b/packages/schema-poller/src/metadataPoller.ts @@ -192,9 +192,9 @@ export class MetadataPoller { this.dbPollingInterval = undefined; } - async startBackgroundPolling(intervalSeconds = 30) { + startBackgroundPolling(intervalSeconds = 30) { this.stopBackgroundPolling(); - await this.fetchDbSchema(); + void this.fetchDbSchema(); this.dbPollingInterval = setInterval( () => void this.fetchDbSchema(), intervalSeconds * 1000, diff --git a/packages/schema-poller/src/schemaPoller.ts b/packages/schema-poller/src/schemaPoller.ts index d6cc0314..38bd9517 100644 --- a/packages/schema-poller/src/schemaPoller.ts +++ b/packages/schema-poller/src/schemaPoller.ts @@ -164,7 +164,7 @@ export class Neo4jSchemaPoller { ); this.metadata = new MetadataPoller(databases, this.connection, this.events); - await this.metadata.startBackgroundPolling(); + this.metadata.startBackgroundPolling(); } private async initializeDriver( diff --git a/packages/vscode-extension/tests/specs/api/autoCompletion.spec.ts b/packages/vscode-extension/tests/specs/api/autoCompletion.spec.ts index 3e3612f9..78c11fb7 100644 --- a/packages/vscode-extension/tests/specs/api/autoCompletion.spec.ts +++ b/packages/vscode-extension/tests/specs/api/autoCompletion.spec.ts @@ -72,7 +72,7 @@ suite('Auto completion spec', () => { }); }); - test.skip('Completes started property with backticks', async () => { + test('Completes started property with backticks', async () => { const position = new vscode.Position(1, 22); const expected: vscode.CompletionItem[] = [