Skip to content

Commit

Permalink
Add vscode lsp version check (#44)
Browse files Browse the repository at this point in the history
* [vscode] Add wdl-lsp version check

* Remove Travis config
  • Loading branch information
dinvlad authored Apr 19, 2024
1 parent a06e243 commit 1c788c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 37 deletions.
34 changes: 0 additions & 34 deletions .travis.old.yml

This file was deleted.

11 changes: 8 additions & 3 deletions client/vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,14 @@ export async function activate(context: ExtensionContext) {
throw new Error(`${language}.pythonPath is not set`);
}

await promisify(execFile)(pythonPath, [
"-m", "pip", "install", "--user", "wdl-lsp==" + version,
]);
const { stdout } = await promisify(execFile)(pythonPath, ["-m", "pip", "show", "wdl-lsp"]);
const versionStr = stdout.split('\n').find(line => line.startsWith('Version:'));
if (!versionStr || versionStr.split(':')[1].trim() !== version) {
await promisify(execFile)(pythonPath, [
"-m", "pip", "install", "--user", "wdl-lsp==" + version,
]);
}

client = startLangServer(pythonPath, ["-m", "wdl_lsp"], cwd);
}

Expand Down

0 comments on commit 1c788c2

Please sign in to comment.