Skip to content

Commit

Permalink
Display warning when launching with no workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock committed Jun 11, 2024
1 parent bed467e commit c99d212
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ export async function activate(context: vscode.ExtensionContext) {
await migrateManagerConfigurations();

if (!vscode.workspace.workspaceFolders) {
// We currently don't support usage without any workspace folders opened. Here we warn the user, point to the issue
// and offer to open a folder instead
const answer = await vscode.window.showWarningMessage(
`Using the Ruby LSP without any workspaces opened is currently not supported
([learn more](https://github.com/Shopify/ruby-lsp/issues/1780))`,
"Open a workspace",
"Continue anyway",
);

if (answer === "Open a workspace") {
await vscode.commands.executeCommand("workbench.action.files.openFolder");
}

return;
}

Expand Down

0 comments on commit c99d212

Please sign in to comment.