From 9b6555ed6ac47ad299abce2e85d1d7446cfad049 Mon Sep 17 00:00:00 2001 From: "evgeniy.generalov" Date: Wed, 16 Jul 2025 13:03:43 +0300 Subject: [PATCH 1/3] Change bridges --- ui2abc/libarkts/native/src/bridges.cc | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/ui2abc/libarkts/native/src/bridges.cc b/ui2abc/libarkts/native/src/bridges.cc index 32bf62c393..82204732c5 100644 --- a/ui2abc/libarkts/native/src/bridges.cc +++ b/ui2abc/libarkts/native/src/bridges.cc @@ -515,7 +515,7 @@ KNativePointer impl_CreateDiagnosticKind(KNativePointer context, KStringPtr& mes } KOALA_INTEROP_3(CreateDiagnosticKind, KNativePointer, KNativePointer, KStringPtr, KInt) -KNativePointer impl_CreateDiagnosticInfo(KNativePointer context, KNativePointer kind, KStringArray argsPtr, KInt argc) +KNativePointer impl_CreateDiagnosticInfo(KNativePointer context, KNativePointer kind, KStringArray argsPtr, KInt argc, KNativePointer pos) { const auto _context = reinterpret_cast(context); const auto _kind = reinterpret_cast(kind); @@ -529,12 +529,13 @@ KNativePointer impl_CreateDiagnosticInfo(KNativePointer context, KNativePointer _args[i] = strdup(std::string(reinterpret_cast(argsPtr + position), strLen).c_str()); position += strLen; } - return GetImpl()->CreateDiagnosticInfo(_context, _kind, _args, argc); + auto&& _pos = reinterpret_cast(pos); + return GetImpl()->CreateDiagnosticInfo(_context, _kind, _args, argc, _pos); } -KOALA_INTEROP_4(CreateDiagnosticInfo, KNativePointer, KNativePointer, KNativePointer, KStringArray, KInt) +KOALA_INTEROP_5(CreateDiagnosticInfo, KNativePointer, KNativePointer, KNativePointer, KStringArray, KInt, KNativePointer) KNativePointer impl_CreateSuggestionInfo(KNativePointer context, KNativePointer kind, KStringArray argsPtr, - KInt argc, KStringPtr& substitutionCode) + KInt argc, KStringPtr& substitutionCode, KNativePointer range) { const auto _context = reinterpret_cast(context); const auto _kind = reinterpret_cast(kind); @@ -549,9 +550,10 @@ KNativePointer impl_CreateSuggestionInfo(KNativePointer context, KNativePointer position += strLen; } const auto _substitutionCode = getStringCopy(substitutionCode); - return GetImpl()->CreateSuggestionInfo(_context, _kind, _args, argc, _substitutionCode); + const auto _range = reinterpret_cast(range); + return GetImpl()->CreateSuggestionInfo(_context, _kind, _args, argc, _substitutionCode, _range); } -KOALA_INTEROP_5(CreateSuggestionInfo, KNativePointer, KNativePointer, KNativePointer, KStringArray, KInt, KStringPtr) +KOALA_INTEROP_6(CreateSuggestionInfo, KNativePointer, KNativePointer, KNativePointer, KStringArray, KInt, KStringPtr, KNativePointer) void impl_LogDiagnostic(KNativePointer context, KNativePointer kind, KStringArray argvPtr, KInt argc, KNativePointer pos) @@ -574,15 +576,14 @@ void impl_LogDiagnostic(KNativePointer context, KNativePointer kind, KStringArra KOALA_INTEROP_V5(LogDiagnostic, KNativePointer, KNativePointer, KStringArray, KInt, KNativePointer) void impl_LogDiagnosticWithSuggestion(KNativePointer context, KNativePointer diagnosticInfo, - KNativePointer suggestionInfo, KNativePointer range) + KNativePointer suggestionInfo) { const auto _context = reinterpret_cast(context); const auto _diagnosticInfo = reinterpret_cast(diagnosticInfo); const auto _suggestionInfo = reinterpret_cast(suggestionInfo); - const auto _range = reinterpret_cast(range); - GetImpl()->LogDiagnosticWithSuggestion(_context, _diagnosticInfo, _suggestionInfo, _range); + GetImpl()->LogDiagnosticWithSuggestion(_context, _diagnosticInfo, _suggestionInfo); } -KOALA_INTEROP_V4(LogDiagnosticWithSuggestion, KNativePointer, KNativePointer, KNativePointer, KNativePointer) +KOALA_INTEROP_V3(LogDiagnosticWithSuggestion, KNativePointer, KNativePointer, KNativePointer) KInt impl_GenerateStaticDeclarationsFromContext(KNativePointer contextPtr, KStringPtr &outputPath) { -- Gitee From f40ad202ad6320fa09c38393defd3e738e0b3b85 Mon Sep 17 00:00:00 2001 From: "evgeniy.generalov" Date: Wed, 16 Jul 2025 13:19:01 +0300 Subject: [PATCH 2/3] Fix ts --- ui2abc/libarkts/src/Es2pandaNativeModule.ts | 11 +++++++---- .../src/wrapper-compat/arkts-api/peers/Diagnostic.ts | 7 ++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ui2abc/libarkts/src/Es2pandaNativeModule.ts b/ui2abc/libarkts/src/Es2pandaNativeModule.ts index da797b0a98..806c32a54b 100644 --- a/ui2abc/libarkts/src/Es2pandaNativeModule.ts +++ b/ui2abc/libarkts/src/Es2pandaNativeModule.ts @@ -188,18 +188,21 @@ export class Es2pandaNativeModule { _CreateDiagnosticKind(context: KNativePointer, message: string, type: Es2pandaPluginDiagnosticType): KNativePointer { throw new Error("Not implemented") } - _CreateDiagnosticInfo(context: KNativePointer, kind: KNativePointer, args: string[], argc: number): KNativePointer { + _CreateDiagnosticInfo(context: KNativePointer, kind: KNativePointer, args: string[], argc: number, pos?: KNativePointer): KNativePointer { + // pos was added in C API throw new Error("Not implemented") } _CreateSuggestionInfo(context: KNativePointer, kind: KNativePointer, args: string[], - argc: number, substitutionCode: string): KNativePointer { + argc: number, substitutionCode: string, range?: KNativePointer): KNativePointer { + // range was added in C API throw new Error("Not implemented") } _LogDiagnostic(context: KNativePointer, kind: KNativePointer, argv: string[], argc: number, pos: KNativePointer): void { throw new Error("Not implemented") } _LogDiagnosticWithSuggestion(context: KNativePointer, diagnosticInfo: KNativePointer, - suggestionInfo?: KNativePointer, range?: KNativePointer): void { + suggestionInfo?: KNativePointer): void { + // range is not used in C API anymore throw new Error("Not implemented") } _SetUpSoPath(soPath: string): void { @@ -258,4 +261,4 @@ export function initGeneratedEs2panda(): GeneratedEs2pandaNativeModule { // registerNativeModule("InteropNativeModule", NativeModule) loadNativeModuleLibrary("NativeModule", instance) return instance -} \ No newline at end of file +} diff --git a/ui2abc/libarkts/src/wrapper-compat/arkts-api/peers/Diagnostic.ts b/ui2abc/libarkts/src/wrapper-compat/arkts-api/peers/Diagnostic.ts index 9b2165ee79..d3069a981c 100644 --- a/ui2abc/libarkts/src/wrapper-compat/arkts-api/peers/Diagnostic.ts +++ b/ui2abc/libarkts/src/wrapper-compat/arkts-api/peers/Diagnostic.ts @@ -32,8 +32,9 @@ export class Diagnostic extends ArktsObject { } static logDiagnosticWithSuggestion(diagnosticInfo: DiagnosticInfo, suggestionInfo: SuggestionInfo, - range: SourceRange): void { - global.es2panda._LogDiagnosticWithSuggestion(global.context, diagnosticInfo.peer, suggestionInfo.peer, range.peer); + range?: SourceRange): void { + console.warn(`Range parameter is not used anymore`) + global.es2panda._LogDiagnosticWithSuggestion(global.context, diagnosticInfo.peer, suggestionInfo.peer); } -} \ No newline at end of file +} -- Gitee From 92fb5e670b4ea30c8e66d2c00e39b0b06a26c14f Mon Sep 17 00:00:00 2001 From: "evgeniy.generalov" Date: Wed, 16 Jul 2025 13:38:19 +0300 Subject: [PATCH 3/3] Fix --- ui2abc/libarkts/src/Es2pandaNativeModule.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ui2abc/libarkts/src/Es2pandaNativeModule.ts b/ui2abc/libarkts/src/Es2pandaNativeModule.ts index 806c32a54b..32d6434986 100644 --- a/ui2abc/libarkts/src/Es2pandaNativeModule.ts +++ b/ui2abc/libarkts/src/Es2pandaNativeModule.ts @@ -188,13 +188,11 @@ export class Es2pandaNativeModule { _CreateDiagnosticKind(context: KNativePointer, message: string, type: Es2pandaPluginDiagnosticType): KNativePointer { throw new Error("Not implemented") } - _CreateDiagnosticInfo(context: KNativePointer, kind: KNativePointer, args: string[], argc: number, pos?: KNativePointer): KNativePointer { - // pos was added in C API + _CreateDiagnosticInfo(context: KNativePointer, kind: KNativePointer, args: string[], argc: number, pos: KNativePointer): KNativePointer { throw new Error("Not implemented") } _CreateSuggestionInfo(context: KNativePointer, kind: KNativePointer, args: string[], - argc: number, substitutionCode: string, range?: KNativePointer): KNativePointer { - // range was added in C API + argc: number, substitutionCode: string, range: KNativePointer): KNativePointer { throw new Error("Not implemented") } _LogDiagnostic(context: KNativePointer, kind: KNativePointer, argv: string[], argc: number, pos: KNativePointer): void { @@ -202,7 +200,6 @@ export class Es2pandaNativeModule { } _LogDiagnosticWithSuggestion(context: KNativePointer, diagnosticInfo: KNativePointer, suggestionInfo?: KNativePointer): void { - // range is not used in C API anymore throw new Error("Not implemented") } _SetUpSoPath(soPath: string): void { -- Gitee