From 1ba3d717ed2cc748c924dc94d52f953165d1dd01 Mon Sep 17 00:00:00 2001 From: Rudy Ges Date: Tue, 30 Jul 2024 15:22:51 +0200 Subject: [PATCH] Update haxe, fix null safety issues (#127) --- .haxerc | 2 +- .../haxe/codeAction/diagnostics/AddTypeHintActions.hx | 2 +- .../haxe/codeAction/diagnostics/MissingArgumentsAction.hx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.haxerc b/.haxerc index 0ea2bfb4..5b42a905 100644 --- a/.haxerc +++ b/.haxerc @@ -1,4 +1,4 @@ { - "version": "15abdcc", + "version": "b537e99", "resolveLibs": "scoped" } diff --git a/src/haxeLanguageServer/features/haxe/codeAction/diagnostics/AddTypeHintActions.hx b/src/haxeLanguageServer/features/haxe/codeAction/diagnostics/AddTypeHintActions.hx index a0c91ff5..b626a980 100644 --- a/src/haxeLanguageServer/features/haxe/codeAction/diagnostics/AddTypeHintActions.hx +++ b/src/haxeLanguageServer/features/haxe/codeAction/diagnostics/AddTypeHintActions.hx @@ -155,7 +155,7 @@ class AddTypeHintActions { return action; final range = if (isFunName) { // add return type hint - final pOpen = defToken.access().firstOf(POpen).token ?? return action; + final pOpen = defToken.access().firstOf(POpen)?.token ?? return action; final pos = pOpen.getPos(); document.rangeAt(pos.max, pos.max, Utf8); } else { diff --git a/src/haxeLanguageServer/features/haxe/codeAction/diagnostics/MissingArgumentsAction.hx b/src/haxeLanguageServer/features/haxe/codeAction/diagnostics/MissingArgumentsAction.hx index e71b8ce6..73b7f2db 100644 --- a/src/haxeLanguageServer/features/haxe/codeAction/diagnostics/MissingArgumentsAction.hx +++ b/src/haxeLanguageServer/features/haxe/codeAction/diagnostics/MissingArgumentsAction.hx @@ -141,12 +141,12 @@ class MissingArgumentsAction { case AnonymousStructure: return "obj"; case ClassField: - return item.args!.field!.name ?? "arg"; + return item.args?.field?.name ?? "arg"; case Expression: if (item.type!.kind == TFun) return "callback"; case _: - return item.args!.name ?? "arg"; + return item.args?.name ?? "arg"; } return genArgNameFromJsonType(item.type); }