about summary refs log tree commit diff
path: root/editors/code/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-08-13 18:35:09 +0000
committerbors <bors@rust-lang.org>2022-08-13 18:35:09 +0000
commitbbe5637bbf0f6dcdc62062f7d50a3947026be9f9 (patch)
tree17d6721e2ed6bafc340eac2970f9813c09fb2b4b /editors/code/src
parent306687b640e0453e4a95de5eae8933f65c9e3757 (diff)
parentec8256dd8027bbe5493698e4b9125f1f0cf8c646 (diff)
downloadrust-bbe5637bbf0f6dcdc62062f7d50a3947026be9f9.tar.gz
rust-bbe5637bbf0f6dcdc62062f7d50a3947026be9f9.zip
Auto merge of #13016 - Veykril:vscode-diag-workaround, r=Veykril
Move VSCode diagnostics workaroudn into client code
Diffstat (limited to 'editors/code/src')
-rw-r--r--editors/code/src/client.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts
index 8a2dea6b35b..40ba17844be 100644
--- a/editors/code/src/client.ts
+++ b/editors/code/src/client.ts
@@ -105,6 +105,15 @@ export async function createClient(
         traceOutputChannel: traceOutputChannel(),
         outputChannel: outputChannel(),
         middleware: {
+            async handleDiagnostics(uri, diagnostics, next) {
+                // Workaround for https://github.com/microsoft/vscode/issues/155531
+                for (const diagnostic of diagnostics) {
+                    if (!diagnostic.message) {
+                        diagnostic.message = " ";
+                    }
+                }
+                next(uri, diagnostics);
+            },
             async provideHover(
                 document: vscode.TextDocument,
                 position: vscode.Position,