diff --git a/src/vscode_plugin/snippets/napi_class_snippets.json b/src/vscode_plugin/snippets/napi_class_snippets.json index 424f298b..a5c03b40 100644 --- a/src/vscode_plugin/snippets/napi_class_snippets.json +++ b/src/vscode_plugin/snippets/napi_class_snippets.json @@ -18,7 +18,7 @@ " napi_ref wrapper_;", "};", "HelloWorld::HelloWorld(): value_(\"\"), env_(nullptr), wrapper_(nullptr) {}", - "HelloWorld::~HelloWorld() {}", + "HelloWorld::~HelloWorld() { napi_delete_reference(env_, wrapper_); }", "void HelloWorld::Destructor(napi_env env, void* nativeObject, [[maybe_unused]] void* finalize_hint)", "{", " reinterpret_cast(nativeObject)->~HelloWorld();", @@ -45,18 +45,18 @@ "}", "napi_value HelloWorld::GetValue(napi_env env, napi_callback_info info)", "{", - " // Todo: you can use \"napigetinfo\" command to get snippets that get js context and arguments.", + " // Todo: you can use \"napiobjectin\" command that get object param from js.", " HelloWorld* obj;", " // Retrieve obj (the C++ object) previously wrapped in jsThis (the ArkTS object), and perform subsequent operations.", " napi_unwrap(env, jsThis, reinterpret_cast(&obj));", - " // Todo: you can use \"napireturn_\" to choose command that return value to js.", + " // Todo: you can use \"napistringutf8out\" command that return string utf8 value to js.", "}", "napi_value HelloWorld::SetValue(napi_env env, napi_callback_info info)", "{", - " // Todo: you can use \"napigetinfo\" command to get snippets that get js context and arguments.", + " // Todo: you can use \"napiobjectin\" command that get object param from js.", " HelloWorld* obj;", " napi_unwrap(env, jsThis, reinterpret_cast(&obj));", - " // Todo: you can use \"napigetparam_\" to choose command that get params from js.", + " // Todo: you can use \"napistringutf8in\" command that get string utf8 param from js.", " return nullptr;", "}", "napi_value HelloWorld::Hello(napi_env env, napi_callback_info info)",