diff --git a/package.json b/package.json index 69be0f88..dd79c7b8 100644 --- a/package.json +++ b/package.json @@ -323,7 +323,8 @@ "name": "Dependencies", "icon": "$(package)", "description": "View and manage dependencies", - "contextualTitle": "Dependencies" + "contextualTitle": "Dependencies", + "when": "rubyLsp.activated" } ] }, diff --git a/src/rubyLsp.ts b/src/rubyLsp.ts index a5a6f083..10879c36 100644 --- a/src/rubyLsp.ts +++ b/src/rubyLsp.ts @@ -169,6 +169,10 @@ export class RubyLsp { await workspace.start(); this.context.subscriptions.push(workspace); + + // If we successfully activated a workspace, then we can start showing the dependencies tree view. This is necessary + // so that we can avoid showing it on non Ruby projects + vscode.commands.executeCommand("setContext", "rubyLsp.activated", true); } // Registers all extension commands. Commands can only be registered once, so this happens in the constructor. For