Skip to content

Commit ffd47d3

Browse files
authored
Merge pull request #599 from krassowski/fix-ci
Workaround file URI matching issue for now
2 parents 309b3fa + 3a8105c commit ffd47d3

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
### (unreleased)
44

55
- Add ability to deactivate Kernel completions or LSP completion through the settings.
6+
- workaround url-parse issue causing problems when using JupyterLab 3.0.15 [#599]
7+
8+
[#599]: https://github.com/krassowski/jupyterlab-lsp/pull/599
69

710
### `jupyter-lsp 1.2.0` (2021-04-26)
811

packages/jupyterlab-lsp/src/connection_manager.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,24 @@ export namespace DocumentConnectionManager {
359359
throw `No language server installed for language ${language}`;
360360
}
361361

362+
// workaround url-parse bug(s) (see https://github.com/krassowski/jupyterlab-lsp/issues/595)
363+
let documentUri = URLExt.join(baseUri, virtual_document.uri);
364+
if (
365+
!documentUri.startsWith('file:///') &&
366+
documentUri.startsWith('file://')
367+
) {
368+
documentUri = documentUri.replace('file://', 'file:///');
369+
if (
370+
documentUri.startsWith('file:///users/') &&
371+
baseUri.startsWith('file:///Users/')
372+
) {
373+
documentUri = documentUri.replace('file:///users/', 'file:///Users/');
374+
}
375+
}
376+
362377
return {
363378
base: baseUri,
364-
document: URLExt.join(baseUri, virtual_document.uri),
379+
document: documentUri,
365380
server: URLExt.join('ws://jupyter-lsp', language),
366381
socket: URLExt.join(
367382
wsBase,

0 commit comments

Comments
 (0)