Skip to content

Commit acc679b

Browse files
Fixed jump to definition for notebooks that have special characters in filename and position for external jumps (#1128)
* fixed working version * fixed jump to definition within notebooks with commas in filename * reverted changes to other files * reverted change * Update .gitignore * Update .gitignore * Fixed external code jump * Lint --------- Co-authored-by: krassowski <5832902+krassowski@users.noreply.github.com>
1 parent 15c5c70 commit acc679b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/code-jumpers/src/jumpers/fileeditor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export class FileEditorJumper extends CodeJumper {
3737
// TODO: this is common
3838
// place cursor in the line with the definition
3939
let position = this.editor.editor.getPositionAt(token.offset)!;
40+
this.editor.editor.setCursorPosition(position);
4041
this.editor.editor.setSelection({ start: position, end: position });
4142
this.editor.editor.focus();
4243
}

packages/jupyterlab-lsp/src/utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ export function urisEqual(a: string, b: string) {
106106
a = normalizeWinPath(a);
107107
b = normalizeWinPath(b);
108108
}
109-
return a === b || decodeURI(a) === decodeURI(b);
109+
return (
110+
a === b || decodeURIComponent(a) === decodeURIComponent(b)
111+
// decodeURIComponent is needed to handle special characters like ','
112+
);
110113
}
111114

112115
/**

0 commit comments

Comments
 (0)