Skip to content

Commit 24fe761

Browse files
committed
Temporarily tolerate pygls usage of nulls for diagnostics
1 parent f6d9656 commit 24fe761

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,12 @@ export class DiagnosticsCM extends CodeMirrorIntegration {
378378
let code = diagnostic.code;
379379
if (
380380
typeof code !== 'undefined' &&
381+
// pygls servers return code null if value is missing (rather than undefined)
382+
// which is a departure from the LSP specs: https://microsoft.github.io/language-server-protocol/specification#diagnostic
383+
// there is an open issue: https://github.com/openlawlibrary/pygls/issues/124
384+
// and PR: https://github.com/openlawlibrary/pygls/pull/132
385+
// this also affects hover tooltips.
386+
code !== null &&
381387
ignoredDiagnosticsCodes.has(code.toString())
382388
) {
383389
return false;

0 commit comments

Comments
 (0)