Skip to content

Commit 968b777

Browse files
brendan0powersbpowers39
authored andcommitted
Handle case where getCursor() returns null in highlighter
1 parent d86925f commit 968b777

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/jupyterlab-lsp/src/features/highlights.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ export class HighlightsCM extends CodeMirrorIntegration {
145145
return;
146146
}
147147

148+
if (!root_position) {
149+
this.console.warn('no root position available');
150+
return;
151+
}
152+
148153
const token = this.virtual_editor.get_token_at(root_position);
149154

150155
// if token has not changed, no need to update highlight, unless it is an empty token

0 commit comments

Comments
 (0)