Commit 2b8291b3 authored by qq_38816927's avatar qq_38816927

自定义

parent 7609524c
...@@ -2,6 +2,8 @@ import { ArkUIViewController, Compose } from 'compose'; ...@@ -2,6 +2,8 @@ import { ArkUIViewController, Compose } from 'compose';
import { hilog } from '@kit.PerformanceAnalysisKit'; import { hilog } from '@kit.PerformanceAnalysisKit';
import nativeApi from 'libentry.so'; import nativeApi from 'libentry.so';
import { testArkTsToArkTs } from './TestJumpClass'; import { testArkTsToArkTs } from './TestJumpClass';
import { MyFunction } from './MyFunction';
//import测试区域 //import测试区域
const DOMAIN = 0x0000; const DOMAIN = 0x0000;
...@@ -23,15 +25,16 @@ struct Index { ...@@ -23,15 +25,16 @@ struct Index {
return; return;
} }
let unusedInt:number = 0;//未使用的变量 let unusedInt:number = 0;//未使用的变量
//ArkTs到Kotlin的单向跳转 //ArkTs到Kotlin的单向跳转
nativeApi.testArkTsToKotin(); nativeApi.testArkTsToKotin();
//原生内部跳转 //原生内部跳转
testArkTsToArkTs(); testArkTsToArkTs();
try { try {
this.controller = nativeApi.MainArkUIViewController(); this.controller = nativeApi.MainArkUIViewController();
const state = this.controller ? 'created' : 'not_created'; const state = this.controller ? 'created' : 'not_created';
...@@ -96,7 +99,7 @@ function testPerformance(){ ...@@ -96,7 +99,7 @@ function testPerformance(){
function testFormat(){ function testFormat(){
//测试后请复原 //测试后请复原
//输入"let a: number = 0;" 保留:和number的间距 //输入"let a: number = 0;" 保留:和number的间距
//选中上列代码(将光标移至代码最左侧,长按向右覆盖整段代码,同复制时的选中复制内容的操作),输入快捷键 //输入快捷键(对全文件生效),无需选中代码
//Mac :Cmd + Option + L (默认) //Mac :Cmd + Option + L (默认)
//Windows:Ctrl + Alt + L (默认) //Windows:Ctrl + Alt + L (默认)
//观察是否复位 代码自动格式化为"let a:number = 0;" //观察是否复位 代码自动格式化为"let a:number = 0;"
...@@ -106,14 +109,25 @@ function testFormat(){ ...@@ -106,14 +109,25 @@ function testFormat(){
//测试代码修复 //测试代码修复
function testRepair(){ function testRepair(){
//输入 "hilop.debug(DOMAIN, 'Compose', 'testRepair');" //输入 "hilop.info(0x0000, 'testTag', 'testRepair');"
//鼠标悬停在 "hilop"上,等待修复窗口出现,观察窗口上是否有修改为"hilog"相关的字样,点击修复选项(包含“change”相关字段)。 //鼠标悬停在 "hilop"上,等待修复窗口出现,观察窗口上是否有修改为"hilog"相关的字样,点击修复选项(包含“change”相关字段)。
//修正为 hilog.debug(DOMAIN, 'Compose', 'testRepair'); //修正为“hilog.info(0x0000, 'testTag', 'testRepair');”
//代码修复测试点 //代码修复测试点
}
//测试代码修复-自定义
function testMyRepair(){
// MyFunction.level2.level3.execute("1");-正确
// MyFunction.level2.level1.execute("1");-错误
//自定义代码修复测试点
} }
//测试Find Usages //测试Find Usages
export function testFindUsages(){ export function testFindUsages(){
//测试引用 //测试引用
......
class Level3 {
public static execute(text: string): void {
console.log(text)
}
}
class Level2 {
public static level3 = Level3
}
class Level1 {
public static level2 = Level2
}
export const MyFunction = Level1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment