File tree Expand file tree Collapse file tree 5 files changed +12
-17
lines changed
packages/jupyterlab-lsp/src
adapters/codemirror/features Expand file tree Collapse file tree 5 files changed +12
-17
lines changed Original file line number Diff line number Diff line change @@ -14,22 +14,15 @@ Python
14
14
15
15
Foreign Extractors
16
16
${file } = Set Variable Foreign extractors.ipynb
17
- # #288: this would need to be restored for latex
18
- #
19
- # Configure JupyterLab Plugin {"language_servers": {"texlab": {"serverSettings": {"latex.lint.onChange": true}}}}
20
- #
17
+ Configure JupyterLab Plugin {"language_servers": {"texlab": {"serverSettings": {"latex.lint.onChange": true}}}}
21
18
Setup Notebook Python ${file }
22
19
# if mypy and pyflakes will fight over `(N|n)ame 'valid'`, just hope for the best
23
20
@{diagnostics } = Create List
24
21
... Failed to parse expression # bash
25
22
... ame 'valid' # python
26
23
... Trailing whitespace is superfluous. # r
27
24
... `frob` is misspelt # markdown
28
- #
29
- # #288: once configured, diagnostics are coming back over the wire, but not displaying
30
- #
31
- # ... Command terminated with space # latex
32
- #
25
+ ... Command terminated with space # latex
33
26
FOR ${diagnostic } IN @{diagnostics }
34
27
Wait Until Page Contains Element css:.cm-lsp-diagnostic[title*\="${diagnostic } "] timeout=35s
35
28
Capture Page Screenshot 0x-${diagnostic } .png
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { Menu } from '@lumino/widgets';
4
4
import { PositionConverter } from '../../../converter' ;
5
5
import { IVirtualPosition , IEditorPosition } from '../../../positioning' ;
6
6
import { diagnosticSeverityNames } from '../../../lsp' ;
7
- import { DefaultMap } from '../../../utils' ;
7
+ import { DefaultMap , uris_equal } from '../../../utils' ;
8
8
import { CodeMirrorLSPFeature , IFeatureCommand } from '../feature' ;
9
9
import { MainAreaWidget } from '@jupyterlab/apputils' ;
10
10
import {
@@ -217,7 +217,7 @@ export class Diagnostics extends CodeMirrorLSPFeature {
217
217
}
218
218
219
219
public handleDiagnostic = ( response : lsProtocol . PublishDiagnosticsParams ) => {
220
- if ( response . uri !== this . virtual_document . document_info . uri ) {
220
+ if ( ! uris_equal ( response . uri , this . virtual_document . document_info . uri ) ) {
221
221
return ;
222
222
}
223
223
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { documentHighlightKindNames } from '../../../lsp';
4
4
import { VirtualDocument } from '../../../virtual/document' ;
5
5
import { IRootPosition } from '../../../positioning' ;
6
6
import { CodeMirrorLSPFeature , IFeatureCommand } from '../feature' ;
7
+ import { uris_equal } from '../../../utils' ;
7
8
8
9
export class Highlights extends CodeMirrorLSPFeature {
9
10
name = 'Highlights' ;
@@ -49,7 +50,7 @@ export class Highlights extends CodeMirrorLSPFeature {
49
50
items : lsProtocol . DocumentHighlight [ ] ,
50
51
documentUri : string
51
52
) => {
52
- if ( documentUri !== this . virtual_document . document_info . uri ) {
53
+ if ( ! uris_equal ( documentUri , this . virtual_document . document_info . uri ) ) {
53
54
return ;
54
55
}
55
56
this . clear_markers ( ) ;
Original file line number Diff line number Diff line change 1
- import { getModifierState } from '../../../utils' ;
1
+ import { getModifierState , uris_equal } from '../../../utils' ;
2
2
import {
3
3
IRootPosition ,
4
4
is_equal ,
@@ -96,7 +96,7 @@ export class Hover extends CodeMirrorLSPFeature {
96
96
}
97
97
98
98
public handleHover = ( response : lsProtocol . Hover , documentUri : string ) => {
99
- if ( documentUri !== this . virtual_document . document_info . uri ) {
99
+ if ( ! uris_equal ( documentUri , this . virtual_document . document_info . uri ) ) {
100
100
return ;
101
101
}
102
102
this . hide_hover ( ) ;
Original file line number Diff line number Diff line change @@ -97,15 +97,16 @@ export function server_root_uri() {
97
97
/**
98
98
* compare two URIs, discounting:
99
99
* - drive capitalization
100
+ * - uri encoding
100
101
* TODO: probably use vscode-uri
101
102
*/
102
103
export function uris_equal ( a : string , b : string ) {
103
104
const win_paths = is_win_path ( a ) && is_win_path ( b ) ;
104
105
if ( win_paths ) {
105
- return normalize_win_path ( a ) === normalize_win_path ( b ) ;
106
- } else {
107
- return a === b ;
106
+ a = normalize_win_path ( a ) ;
107
+ b = normalize_win_path ( b ) ;
108
108
}
109
+ return a === b || decodeURI ( a ) === decodeURI ( b ) ;
109
110
}
110
111
111
112
/**
You can’t perform that action at this time.
0 commit comments