Skip to content

Commit

Permalink
Special handling for empty Json RPC Diagnostics (#125)
Browse files Browse the repository at this point in the history
* Special handling for empty json diagnostics
See HaxeFoundation/haxe#11709
  • Loading branch information
kLabz committed Jul 17, 2024
1 parent 792bf73 commit 909d4a9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/haxeLanguageServer/Context.hx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ class Context {
final includeDisplayArguments = method.startsWith("display/") || method == ServerMethods.ReadClassPaths;
callDisplay(method, [Json.stringify(message)], token, function(result:DisplayResult) {
switch result {
case DResult("") if (method == DisplayMethods.Diagnostics):
haxeDisplayProtocol.handleMessage(({
jsonrpc: Protocol.PROTOCOL_VERSION,
id: (cast message : RequestMessage).id,
result: {result: []}
} : ResponseMessage));
case DResult(msg):
haxeDisplayProtocol.handleMessage(Json.parse(msg));
case DCancelled:
Expand Down

0 comments on commit 909d4a9

Please sign in to comment.