Skip to content

Commit 1ffd638

Browse files
committed
Special handling for empty json diagnostics
See HaxeFoundation/haxe#11709
1 parent 792bf73 commit 1ffd638

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/haxeLanguageServer/Context.hx

+6
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ class Context {
102102
final includeDisplayArguments = method.startsWith("display/") || method == ServerMethods.ReadClassPaths;
103103
callDisplay(method, [Json.stringify(message)], token, function(result:DisplayResult) {
104104
switch result {
105+
case DResult("") if (method == DisplayMethods.Diagnostics):
106+
haxeDisplayProtocol.handleMessage(({
107+
jsonrpc: Protocol.PROTOCOL_VERSION,
108+
id: @:privateAccess haxeDisplayProtocol.nextRequestId - 1, // ew..
109+
result: {result: []}
110+
}:ResponseMessage));
105111
case DResult(msg):
106112
haxeDisplayProtocol.handleMessage(Json.parse(msg));
107113
case DCancelled:

0 commit comments

Comments
 (0)