Skip to content

Commit

Permalink
Curlies
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Jul 3, 2024
1 parent fa33a1d commit 7ad2553
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
16 changes: 10 additions & 6 deletions src/haxeLanguageServer/features/haxe/DiagnosticsFeature.hx
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ class DiagnosticsFeature {
} else {
context.callDisplay("global diagnostics", ["diagnostics"], null, null, function(result) {
final data = parseLegacyDiagnostics(result);
if (data == null)
if (data == null) {
clearDiagnosticsOnClient(errorUri);
else
} else {
processDiagnosticsReply(null, onResolve, data);
}
context.languageServerProtocol.sendNotification(LanguageServerMethods.DidRunRunGlobalDiagnostics);
stopProgress();
}, function(error) {
Expand Down Expand Up @@ -337,8 +338,9 @@ class DiagnosticsFeature {
if (context.config.user.diagnosticsForAllOpenFiles) {
context.documents.iter(function(doc) {
final path = doc.uri.toFsPath();
if (doc.languageId == "haxe" && !isPathFiltered(path))
if (doc.languageId == "haxe" && !isPathFiltered(path)) {
params.fileContents.sure().push({file: path, contents: null});
}
});
} else {
params.file = doc.uri.toFsPath();
Expand All @@ -356,10 +358,11 @@ class DiagnosticsFeature {
context.callDisplay("@diagnostics", [doc.uri.toFsPath() + "@0@diagnostics"], null, token, result -> {
pendingRequests.remove(uri);
final data = parseLegacyDiagnostics(result);
if (data == null)
if (data == null) {
clearDiagnosticsOnClient(errorUri);
else
} else {
processDiagnosticsReply(null, onResolve, data);
}
}, error -> {
pendingRequests.remove(uri);
processErrorReply(uri, error);
Expand All @@ -372,8 +375,9 @@ class DiagnosticsFeature {

function cancelPendingRequest(uri:DocumentUri) {
if (useJsonRpc && context.config.user.diagnosticsForAllOpenFiles) {
for (tokenSource in pendingRequests)
for (tokenSource in pendingRequests) {
tokenSource.cancel();
}
pendingRequests.clear();
} else {
var tokenSource = pendingRequests[uri];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,10 @@ class OrganizeImportsFeature {
edits = edits.concat(organizeImportGroup(doc, context, group));
}

if (last != null)
if (last != null) {
edits = edits.concat(organizeImportGroup(doc, context, last));
}

return edits;
}

Expand Down

0 comments on commit 7ad2553

Please sign in to comment.