• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2025 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14if ((defined(ark_standalone_build) && ark_standalone_build) ||
15    (defined(ark_static_standalone_build) && ark_static_standalone_build)) {
16  import("//arkcompiler/runtime_core/static_core/ark_config.gni")
17} else {
18  import(
19      "//build/config/components/runtime_core/static_core/ark_common_config.gni")
20}
21
22if (ark_standalone_build) {
23  import("$build_root/ark.gni")
24} else {
25  import("//build/ohos.gni")
26}
27
28declare_args() {
29  lsp_build_enable = false
30  bindings_build_enable = false
31}
32
33group("lsp_packages") {
34  if (lsp_build_enable) {
35    deps = [ ":libes2panda_lsp" ]
36  }
37  if (bindings_build_enable) {
38    deps = [ "../bindings:ts_bindings" ]
39  }
40}
41
42config("libes2panda_lsp_config") {
43  include_dirs = [ "include" ]
44  cflags_cc = [ "-Wno-return-type-c-linkage" ]
45}
46
47ohos_source_set("libes2panda_lsp_static") {
48  sources = [
49    "src/api.cpp",
50    "src/applicable_refactors.cpp",
51    "src/brace_matching.cpp",
52    "src/cancellation_token.cpp",
53    "src/class_hierarchy.cpp",
54    "src/class_hierarchy_info.cpp",
55    "src/classifier.cpp",
56    "src/code_fix_provider.cpp",
57    "src/completions.cpp",
58    "src/completions_details.cpp",
59    "src/create_type_help_items.cpp",
60    "src/find_references.cpp",
61    "src/find_rename_locations.cpp",
62    "src/find_safe_delete_location.cpp",
63    "src/formatting/formatting.cpp",
64    "src/formatting/formatting_context.cpp",
65    "src/formatting/formatting_settings.cpp",
66    "src/formatting/rules.cpp",
67    "src/formatting/rules_map.cpp",
68    "src/generate_constructor.cpp",
69    "src/get_adjusted_location.cpp",
70    "src/get_class_property_info.cpp",
71    "src/get_definition_and_bound_span.cpp",
72    "src/get_name_or_dotted_name_span.cpp",
73    "src/get_safe_delete_info.cpp",
74    "src/inlay_hints.cpp",
75    "src/internal_api.cpp",
76    "src/isolated_declaration.cpp",
77    "src/line_column_offset.cpp",
78    "src/navigate_to.cpp",
79    "src/organize_imports.cpp",
80    "src/quick_info.cpp",
81    "src/refactor_provider.cpp",
82    "src/refactors/convert_chain.cpp",
83    "src/refactors/convert_export.cpp",
84    "src/refactors/convert_function.cpp",
85    "src/refactors/convert_import.cpp",
86    "src/refactors/convert_template.cpp",
87    "src/refactors/refactor_types.cpp",
88    "src/references.cpp",
89    "src/register_code_fix/add_missing_declare_property.cpp",
90    "src/register_code_fix/fix_missing_call_parantheses.cpp",
91    "src/register_code_fix/fix_nan_equality.cpp",
92    "src/register_code_fix/forgetten_this_property_access.cpp",
93    "src/register_code_fix/import_fixes.cpp",
94    "src/rename.cpp",
95    "src/register_code_fix/ui_plugin_suggest.cpp",
96    "src/script_element_kind.cpp",
97    "src/services/services.cpp",
98    "src/services/text_change/change_tracker.cpp",
99    "src/services/utilities.cpp",
100    "src/signature_help.cpp",
101    "src/signature_help_items.cpp",
102    "src/string_completions.cpp",
103    "src/suggestion_diagnostics.cpp",
104    "src/todo_comments.cpp",
105    "src/types.cpp",
106  ]
107  if ((defined(ark_standalone_build) && ark_standalone_build) ||
108      (defined(ark_static_standalone_build) && ark_static_standalone_build)) {
109    configs = [ "$ark_root:ark_config" ]
110  } else {
111    configs = [
112      "//build/config/components/runtime_core/static_core:ark_common_config",
113    ]
114  }
115  configs += [
116    "$ark_root/assembler:arkassembler_public_config",
117    "../:libes2panda_public_config",
118    "../:libes2panda_config",
119    "$ark_root/libpandabase:arkbase_public_config",
120    "$ark_root/libpandafile:arkfile_public_config",
121    ":libes2panda_lsp_config",
122  ]
123
124  deps = [
125    "../:libes2panda_frontend_static",
126    "../:libes2panda_public_frontend_static",
127  ]
128
129  external_deps = [
130    "runtime_core:libarktsbytecodeopt_package",
131    sdk_libc_secshared_dep,
132  ]
133  part_name = "ets_frontend"
134  subsystem_name = "arkcompiler"
135}
136
137ohos_shared_library("libes2panda_lsp") {
138  deps = [ ":libes2panda_lsp_static" ]
139  output_extension = "so"
140  part_name = "ets_frontend"
141  subsystem_name = "arkcompiler"
142}
143