• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (c) 2025 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "lsp/include/register_code_fix/import_fixes.h"
17 #include <iostream>
18 #include <string>
19 #include "lsp/include/code_fix_provider.h"
20 #include "lsp/include/internal_api.h"
21 
22 namespace ark::es2panda::lsp {
23 const int G_IMPORT_FIXES_CODE = 1005;  // change this to the error code you want to handle
24 
ImportFixes()25 ImportFixes::ImportFixes()
26 {
27     const char *importFixesId = "ImportFixes";
28     SetErrorCodes({G_IMPORT_FIXES_CODE});  // change this to the error code you want to handle
29     SetFixIds({importFixesId});
30 }
31 
GetCodeActions(const CodeFixContext & context)32 std::vector<CodeFixAction> ImportFixes::GetCodeActions(const CodeFixContext &context)
33 {
34     std::vector<CodeFixAction> returnedActions;
35     if (context.errorCode == G_IMPORT_FIXES_CODE) {
36     }
37     return returnedActions;
38 }
39 
GetAllCodeActions(const CodeFixAllContext & codeFixAll)40 CombinedCodeActions ImportFixes::GetAllCodeActions(const CodeFixAllContext &codeFixAll)
41 {
42     CombinedCodeActions combinedCodeActions;
43     if (codeFixAll.fixId == "ImportFixes") {
44     }
45 
46     return combinedCodeActions;
47 }
48 // NOLINTNEXTLINE(fuchsia-statically-constructed-objects, cert-err58-cpp)
49 AutoCodeFixRegister<ImportFixes> g_importFixes("ImportFixes");
50 }  // namespace ark::es2panda::lsp
51