Skip to content

Commit

Permalink
chore: remove compat paths for lsp < 1.37.0 (#992)
Browse files Browse the repository at this point in the history
  • Loading branch information
nayeemrmn authored Nov 16, 2023
1 parent 62b1f34 commit 30d03e4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,22 @@ extension has the following configuration options:
APIs. This is the equivalent to using `--unstable` on the command line.
_boolean, default `false`_

## Compatibility

To see which versions of the Deno CLI are compatible with which versions of this
extension, consult the following table.

| vscode-deno | Deno CLI |
| ------------ | -------------- |
| TODO onwards | 1.37.0 onwards |
| ? - 3.27.0 | ? - 1.36.4 |

Version ranges are inclusive. Incompatibilites prior to 3.27.0 were not tracked.

## Contribute

[Learn how to setup & contribute to this project](.github/CONTRIBUTING.md)


## Thanks

This project was inspired by
Expand Down
14 changes: 0 additions & 14 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,6 @@ function getWorkspaceSettings(): Settings {
const workspaceSettings = Object.create(null);
for (const key of workspaceSettingsKeys) {
workspaceSettings[key] = config.get(key);
// TODO(nayeemrmn): Deno LSP versions < 1.37.0 require `deno.enable` to be
// non-null. Eventually remove this.
if (
semver.lt(extensionContext.serverInfo?.version ?? "1.0.0", "1.37.0-rc") &&
key == "enable"
) {
workspaceSettings[key] ??= false;
}
}
workspaceSettings.javascript = Object.create(null);
workspaceSettings.typescript = Object.create(null);
Expand Down Expand Up @@ -393,12 +385,6 @@ export async function activate(
handleDocumentOpen(...vscode.workspace.textDocuments);

await commands.startLanguageServer(context, extensionContext)();
// TODO(nayeemrmn): Deno LSP versions < 1.37.0 has different compat logic.
// We restart here if it's detected. Eventually remove this.
if (!semver.lt(extensionContext.serverInfo!.version, "1.37.0-rc")) {
extensionContext.workspaceSettings = getWorkspaceSettings();
await commands.startLanguageServer(context, extensionContext)();
}

const treeDataProvider = registerSidebar(
extensionContext,
Expand Down

0 comments on commit 30d03e4

Please sign in to comment.