From 70a9a76b79bd5c828b99c07aedeb306e6d49cd89 Mon Sep 17 00:00:00 2001 From: RblSb Date: Wed, 4 Mar 2026 21:11:18 +0300 Subject: [PATCH 1/3] Fix null safety errors --- .haxerc | 2 +- haxe_libraries/safety.hxml | 4 ++-- haxe_libraries/utest.hxml | 4 ++-- src/haxeLanguageServer/Context.hx | 15 +++++++-------- .../features/haxe/completion/CompletionFeature.hx | 2 +- test/testcases/EditTestCaseMacro.hx | 5 ++--- 6 files changed, 15 insertions(+), 17 deletions(-) diff --git a/.haxerc b/.haxerc index fc7d7fce..e4024840 100644 --- a/.haxerc +++ b/.haxerc @@ -1,4 +1,4 @@ { - "version": "8d19bc5", + "version": "033a9fd", "resolveLibs": "scoped" } diff --git a/haxe_libraries/safety.hxml b/haxe_libraries/safety.hxml index 973dc8b9..cd2cdaab 100644 --- a/haxe_libraries/safety.hxml +++ b/haxe_libraries/safety.hxml @@ -1,3 +1,3 @@ -# @install: lix --silent download "haxelib:/safety#1.1.2" into safety/1.1.2/haxelib --cp ${HAXE_LIBCACHE}/safety/1.1.2/haxelib/src +# @install: lix --silent download "gh://github.com/RealyUniqueName/Safety#b3f1c34ef185d127196b04541950c32b7683863f" into safety/1.1.2/github/b3f1c34ef185d127196b04541950c32b7683863f +-cp ${HAXE_LIBCACHE}/safety/1.1.2/github/b3f1c34ef185d127196b04541950c32b7683863f/src -D safety=1.1.2 \ No newline at end of file diff --git a/haxe_libraries/utest.hxml b/haxe_libraries/utest.hxml index f0776850..e6efb71c 100644 --- a/haxe_libraries/utest.hxml +++ b/haxe_libraries/utest.hxml @@ -1,4 +1,4 @@ -# @install: lix --silent download "gh://github.com/haxe-utest/utest#bdb5fec4b8e77d9a3c079d9cfb108f29f153721a" into utest/2.0.0-alpha/github/bdb5fec4b8e77d9a3c079d9cfb108f29f153721a --cp ${HAXE_LIBCACHE}/utest/2.0.0-alpha/github/bdb5fec4b8e77d9a3c079d9cfb108f29f153721a/src +# @install: lix --silent download "gh://github.com/haxe-utest/utest#a055e05e2e872ae12a32b53d0200612345059c38" into utest/2.0.0-alpha/github/a055e05e2e872ae12a32b53d0200612345059c38 +-cp ${HAXE_LIBCACHE}/utest/2.0.0-alpha/github/a055e05e2e872ae12a32b53d0200612345059c38/src -D utest=2.0.0-alpha --macro utest.utils.Macro.importEnvSettings() diff --git a/src/haxeLanguageServer/Context.hx b/src/haxeLanguageServer/Context.hx index eb2632e7..e1752d8c 100644 --- a/src/haxeLanguageServer/Context.hx +++ b/src/haxeLanguageServer/Context.hx @@ -83,7 +83,7 @@ class Context { haxeDisplayProtocol = new Protocol(@:nullSafety(Off) writeMessage); haxeServer = @:nullSafety(Off) new HaxeServer(this); documents = new TextDocuments(); - config = new Configuration(languageServerProtocol, kind -> restartServer('$kind configuration was changed')); + config = new Configuration(languageServerProtocol, kind -> @:nullSafety(Off) restartServer('$kind configuration was changed')); languageServerProtocol.onRequest(InitializeRequest.type, onInitialize); languageServerProtocol.onRequest(ShutdownRequest.type, onShutdown); @@ -105,7 +105,7 @@ class Context { return; // don't send cancel notifications, not supported by Haxe } final includeDisplayArguments = method.startsWith("display/") || method == ServerMethods.ReadClassPaths; - callDisplay(method, [Json.stringify(message)], token, function(result:DisplayResult) { + callDisplay(method, [Json.stringify(message)], null, token, function(result:DisplayResult) { switch result { case DResult("") if (method == DisplayMethods.Diagnostics): haxeDisplayProtocol.handleMessage(({ @@ -122,15 +122,14 @@ class Context { Json.parse(error); } catch (_:Any) { // pretend we got a proper JSON (HaxeFoundation/haxe#7955) + final errData:HaxeResponseErrorData = { + severity: Error, + message: error + } final message:ResponseMessage = { jsonrpc: Protocol.PROTOCOL_VERSION, id: @:privateAccess haxeDisplayProtocol.nextRequestId - 1, // ew.. - error: new ResponseError(ResponseError.InternalError, "Compiler error", ([ - { - severity: Error, - message: error - } - ] : HaxeResponseErrorData)) + error: new ResponseError(ResponseError.InternalError, "Compiler error", [errData]) } message; }); diff --git a/src/haxeLanguageServer/features/haxe/completion/CompletionFeature.hx b/src/haxeLanguageServer/features/haxe/completion/CompletionFeature.hx index 9818adfa..2ef49670 100644 --- a/src/haxeLanguageServer/features/haxe/completion/CompletionFeature.hx +++ b/src/haxeLanguageServer/features/haxe/completion/CompletionFeature.hx @@ -67,7 +67,7 @@ class CompletionFeature { explicitNull: true }); - legacy = new CompletionFeatureLegacy(context, contextSupport, formatDocumentation); + legacy = new CompletionFeatureLegacy(context, contextSupport, @:nullSafety(Off) formatDocumentation); } function checkCapabilities() { diff --git a/test/testcases/EditTestCaseMacro.hx b/test/testcases/EditTestCaseMacro.hx index e0136dd0..8fea40f7 100644 --- a/test/testcases/EditTestCaseMacro.hx +++ b/test/testcases/EditTestCaseMacro.hx @@ -46,9 +46,8 @@ class EditTestCaseMacro { } static function collectAllFileNames(path:String):Array { - #if display - return []; - #end + if (Context.defined("display")) + return []; final items:Array = FileSystem.readDirectory(path); var files:Array = []; for (item in items) { From 777fa1ae6a1a089ed98a2096e030d6944c9fc839 Mon Sep 17 00:00:00 2001 From: RblSb Date: Wed, 4 Mar 2026 21:25:16 +0300 Subject: [PATCH 2/3] idk where is vanilla installation instructions --- install.hxml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.hxml b/install.hxml index 0ce43723..21bdc5d5 100644 --- a/install.hxml +++ b/install.hxml @@ -4,7 +4,7 @@ -lib hxparse:git:https://github.com/simn/hxparse#876070ec62a4869de60081f87763e23457a3bda8 -lib json2object:git:https://github.com/elnabo/json2object#a75859de1e966c09e73591b6c9186086c143fe60 -lib test-adapter:3.0.0 --lib utest:git:https://github.com/haxe-utest/utest#bdb5fec4b8e77d9a3c079d9cfb108f29f153721a +-lib utest:git:https://github.com/haxe-utest/utest#a055e05e2e872ae12a32b53d0200612345059c38 -lib hxnodejs:git:https://github.com/HaxeFoundation/hxnodejs#504066d -lib tokentree:1.2.18 -lib language-server-protocol:git:https://github.com/vshaxe/language-server-protocol-haxe#20a7f976bc83ec6623cc25144c88f4c15a799586 @@ -12,4 +12,4 @@ -lib vscode-json-rpc:git:https://github.com/vshaxe/vscode-json-rpc#0160f06bc9df1dd0547f2edf23753540db74ed5b -lib rename:3.0.1 -lib vshaxe-build:git:https://github.com/vshaxe/vshaxe-build#39ab9c6315ae76080e5399391c8fa561daec6d55 --lib safety:1.1.2 +-lib safety:git:https://github.com/RealyUniqueName/Safety#b3f1c34ef185d127196b04541950c32b7683863f From 3cbe2ece240fee52c870dde0b276e08783dfa6c7 Mon Sep 17 00:00:00 2001 From: RblSb Date: Wed, 4 Mar 2026 21:34:36 +0300 Subject: [PATCH 3/3] update haxe-version --- .github/workflows/main-vanilla.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main-vanilla.yml b/.github/workflows/main-vanilla.yml index 7bdd07eb..721f0df3 100644 --- a/.github/workflows/main-vanilla.yml +++ b/.github/workflows/main-vanilla.yml @@ -10,7 +10,7 @@ jobs: # TODO: fix tests on windows and enable again # os: [ubuntu-latest, macos-13, windows-latest] os: [ubuntu-latest, macos-13] - haxe: [latest, "2025-08-04_development_8d19bc5"] + haxe: [latest, "2026-03-04_development_033a9fd"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2