diff --git a/ui2abc/libarkts/native/src/bridges.cc b/ui2abc/libarkts/native/src/bridges.cc index 32bf62c393d44fd42c52455f63cd23c4ca7c571f..82204732c5fee9069f9295b66edf47e8531df49a 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) { diff --git a/ui2abc/libarkts/src/Es2pandaNativeModule.ts b/ui2abc/libarkts/src/Es2pandaNativeModule.ts index da797b0a98d85e97df9b3e0d56c03b77c1982621..32d64349865c65cdfb3d14a0b8a193fe54909fd0 100644 --- a/ui2abc/libarkts/src/Es2pandaNativeModule.ts +++ b/ui2abc/libarkts/src/Es2pandaNativeModule.ts @@ -188,18 +188,18 @@ 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 { throw new Error("Not implemented") } _CreateSuggestionInfo(context: KNativePointer, kind: KNativePointer, args: string[], - argc: number, substitutionCode: string): KNativePointer { + argc: number, substitutionCode: string, range: KNativePointer): KNativePointer { 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 { throw new Error("Not implemented") } _SetUpSoPath(soPath: string): void { @@ -258,4 +258,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 9b2165ee797e717ab6f49b716f833171ec200e1c..d3069a981cfedc495d8135e4a0b494fc59cea9c6 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 +}