diff --git a/packages/jupyterlab-lsp/src/features/highlights.ts b/packages/jupyterlab-lsp/src/features/highlights.ts index 06bcc5b8a..2503ce9c6 100644 --- a/packages/jupyterlab-lsp/src/features/highlights.ts +++ b/packages/jupyterlab-lsp/src/features/highlights.ts @@ -145,6 +145,11 @@ export class HighlightsCM extends CodeMirrorIntegration { return; } + if (root_position == null) { + console.warn('no root position available'); + return; + } + const token = this.virtual_editor.get_token_at(root_position); // if token has not changed, no need to update highlight, unless it is an empty token