mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Publish empty diagnostics on close (#4954)
Without this, diagnostics will linger after closing a file. This refactors towards a pattern of putting outgoing calls as methods on `Context`. I'm mixed on this, mainly thinking it's an improvement on using `outgoing` directly (because it shares the name and structure), might want to move it to a side-class later that is _only_ LSP wrappers. I could also make inheritance private on OutgoingMessages and these kinds of methods public there, but I'm hesitant to adopt that approach versus a type separation.
This commit is contained in:
@@ -119,6 +119,15 @@
|
||||
// CHECK:STDOUT: "uri": "file:///test.carbon",
|
||||
// CHECK:STDOUT: "version": 2
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }Content-Length: 144{{\r}}
|
||||
// CHECK:STDOUT: {{\r}}
|
||||
// CHECK:STDOUT: {
|
||||
// CHECK:STDOUT: "jsonrpc": "2.0",
|
||||
// CHECK:STDOUT: "method": "textDocument/publishDiagnostics",
|
||||
// CHECK:STDOUT: "params": {
|
||||
// CHECK:STDOUT: "diagnostics": [],
|
||||
// CHECK:STDOUT: "uri": "file:///test.carbon"
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }Content-Length: 51{{\r}}
|
||||
// CHECK:STDOUT: {{\r}}
|
||||
// CHECK:STDOUT: {
|
||||
|
||||
@@ -55,6 +55,15 @@
|
||||
// CHECK:STDOUT: "diagnostics": [],
|
||||
// CHECK:STDOUT: "uri": "file:///test.carbon"
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }Content-Length: 144{{\r}}
|
||||
// CHECK:STDOUT: {{\r}}
|
||||
// CHECK:STDOUT: {
|
||||
// CHECK:STDOUT: "jsonrpc": "2.0",
|
||||
// CHECK:STDOUT: "method": "textDocument/publishDiagnostics",
|
||||
// CHECK:STDOUT: "params": {
|
||||
// CHECK:STDOUT: "diagnostics": [],
|
||||
// CHECK:STDOUT: "uri": "file:///test.carbon"
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }Content-Length: 51{{\r}}
|
||||
// CHECK:STDOUT: {{\r}}
|
||||
// CHECK:STDOUT: {
|
||||
|
||||
Reference in New Issue
Block a user