Skip to content

Commit

Permalink
Formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Jan 8, 2025
1 parent 3d9d7e5 commit 3c00ba7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
12 changes: 8 additions & 4 deletions src/haxeLanguageServer/features/haxe/DiagnosticsFeature.hx
Original file line number Diff line number Diff line change
Expand Up @@ -464,10 +464,14 @@ private typedef DiagnosticsMapKey = {code:Int, ?range:Range};

private class DiagnosticsMap<T> extends BalancedTree<DiagnosticsMapKey, T> {
override function compare(k1:DiagnosticsMapKey, k2:DiagnosticsMapKey) {
if (k1.code != k2.code) return k1.code - k2.code;
if (k1.range == null && k2.range == null) return 0;
if (k1.range == null) return -1;
if (k2.range == null) return 1;
if (k1.code != k2.code)
return k1.code - k2.code;
if (k1.range == null && k2.range == null)
return 0;
if (k1.range == null)
return -1;
if (k2.range == null)
return 1;

final start1 = k1.range.start;
final start2 = k2.range.start;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ class CompilerErrorActions {
}

if (context.haxeServer.haxeVersion.major >= 4 // unsuitable error range before Haxe 4
&& diagnostic.range != null
&& arg.contains("should be declared with 'override' since it is inherited from superclass")) {
&& diagnostic.range != null && arg.contains("should be declared with 'override' since it is inherited from superclass")) {
var pos = diagnostic.range.start;
final document = context.documents.getHaxe(params.textDocument.uri);
if (document.tokens != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ class UnresolvedIdentifierActions {
}

static function createTypoActions(context:Context, params:CodeActionParams, diagnostic:Diagnostic, arg):Array<CodeAction> {
if (diagnostic.range == null) return [];
if (diagnostic.range == null)
return [];

return [
{
Expand Down

0 comments on commit 3c00ba7

Please sign in to comment.