From 6428a3d7a60072342ad2eefbeee48124494ccfda Mon Sep 17 00:00:00 2001 From: Vincenzo Barbuto Date: Tue, 23 Apr 2024 10:34:12 -0700 Subject: [PATCH] Bug Fix - wait until LS is ready to handle requests --- .gitignore | 1 + src/lfview/lf-data-provider.ts | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 183a375d3..13c4b9cbc 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ node_modules/* out/* .gradle/* __pycache__/* +.DS_Store diff --git a/src/lfview/lf-data-provider.ts b/src/lfview/lf-data-provider.ts index 49a4e1ded..43e035eb0 100644 --- a/src/lfview/lf-data-provider.ts +++ b/src/lfview/lf-data-provider.ts @@ -15,9 +15,10 @@ export class LFDataProvider implements vscode.TreeDataProvider { if (!element) { - this.client.sendRequest('generator/getLibraryReactors').then(message => { - - console.log("+++++++++++++++++++++++++" + message) + this.client.onReady().then(() => { + this.client.sendRequest('generator/getLibraryReactors').then(message => { + console.log("+++++++++++++++++++++++++" + message) + }) }) let result = [] return vscode.workspace.findFiles('**/lib/*.lf').then(files => {