Skip to content

Commit 6d75d0d

Browse files
authored
Ensure pony-lsp emits diagnostics for all documents (#4891)
1 parent 0fd147a commit 6d75d0d

File tree

5 files changed

+10
-200
lines changed

5 files changed

+10
-200
lines changed

.release-notes/4891.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Fix pony-lsp issue not emitting diagnostics for some documents
2+
3+
Pony-lsp now is no longer randomly swallowing diagnostics and not emitting them to the lsp client, the editor.

tools/corral.json

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
{
2-
"packages": [
3-
"pony-lsp",
4-
"pony-lsp/workspace",
5-
"pony-lsp/test"
6-
],
2+
"packages": ["pony-lsp", "pony-lsp/workspace", "pony-lsp/test"],
73
"deps": [
84
{
9-
"locator": "./lib/mfelsche/pony-immutable-json"
10-
},
11-
{
12-
"locator": "./lib/mfelsche/pony-ast"
5+
"locator": "./lib/ponylang/json-ng"
136
},
147
{
15-
"locator": "./lib/mfelsche/pony-binarysearch"
8+
"locator": "./lib/ponylang/pony_compiler"
169
},
1710
{
1811
"locator": "./lib/ponylang/peg"

tools/pony-lsp/lsp_document.pony

Lines changed: 0 additions & 107 deletions
This file was deleted.

tools/pony-lsp/lsp_language.pony

Lines changed: 0 additions & 82 deletions
This file was deleted.

tools/pony-lsp/workspace/manager.pony

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ actor WorkspaceManager
205205
if this._client.supports_publish_diagnostics() then
206206
for file in errors_by_file.keys() do
207207
try
208-
let file_errors: pc.Vec[JsonValue] = recover val errors_by_file.remove(file)?._2 end
208+
let file_errors: pc.Vec[JsonValue] = errors_by_file(file)?
209209
let msg = Notification.create(
210210
Methods.text_document().publish_diagnostics(),
211211
JsonObject
@@ -237,6 +237,9 @@ actor WorkspaceManager
237237
// to make sure we don't see any old diagnostics anymore
238238
this._request_sender.send_request(Methods.workspace().diagnostic().refresh(), None)
239239
end
240+
else
241+
this._channel.log("Received compilation result for run " + run.string() +
242+
" but already received results for run " + this._compile_run.string())
240243
end
241244

242245

0 commit comments

Comments
 (0)