diff --git a/vscode/src/dependenciesTree.ts b/vscode/src/dependenciesTree.ts index c162edd1f..dfc88552d 100644 --- a/vscode/src/dependenciesTree.ts +++ b/vscode/src/dependenciesTree.ts @@ -1,6 +1,7 @@ import path from "path"; import * as vscode from "vscode"; +import { State } from "vscode-languageclient"; import { STATUS_EMITTER, WorkspaceInterface } from "./common"; @@ -148,11 +149,17 @@ export class DependenciesTree private async fetchDependencies(): Promise { this.gemRootFolders = {}; - if (!this.currentWorkspace || !this.currentWorkspace.lspClient) { + if (!this.currentWorkspace) { return []; } - const resp = (await this.currentWorkspace.lspClient.sendRequest( + const client = this.currentWorkspace.lspClient; + + if (!client || client.state !== State.Running) { + return []; + } + + const resp = (await client.sendRequest( "rubyLsp/workspace/dependencies", {}, )) as [