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 14set(ES2PANDA_LSP_SRC 15 ./src/api.cpp 16 ./src/class_hierarchy.cpp 17 ./src/class_hierarchy_info.cpp 18 ./src/classifier.cpp 19 ./src/internal_api.cpp 20 ./src/isolated_declaration.cpp 21 ./src/cancellation_token.cpp 22 ./src/completions.cpp 23 ./src/organize_imports.cpp 24 ./src/quick_info.cpp 25 ./src/completions_details.cpp 26 ./src/references.cpp 27 ./src/get_adjusted_location.cpp 28 ./src/get_safe_delete_info.cpp 29 ./src/find_rename_locations.cpp 30 ./src/find_safe_delete_location.cpp 31 ./src/find_references.cpp 32 ./src/refactors/refactor_types.cpp 33 ./src/applicable_refactors.cpp 34 ./src/refactor_provider.cpp 35 ./src/refactors/convert_chain.cpp 36 ./src/refactors/convert_export.cpp 37 ./src/refactors/convert_function.cpp 38 ./src/refactors/convert_import.cpp 39 ./src/refactors/convert_template.cpp 40 ./src/formatting/formatting_context.cpp 41 ./src/formatting/formatting_settings.cpp 42 ./src/formatting/formatting.cpp 43 ./src/formatting/rules_map.cpp 44 ./src/formatting/rules.cpp 45 ./src/string_completions.cpp 46 ./src/rename.cpp 47 ./src/generate_constructor.cpp 48 ./src/suggestion_diagnostics.cpp 49 ./src/brace_matching.cpp 50 ./src/services/services.cpp 51 ./src/services/utilities.cpp 52 ./src/line_column_offset.cpp 53 ./src/services/text_change/change_tracker.cpp 54 ./src/code_fix_provider.cpp 55 ./src/inlay_hints.cpp 56 ./src/get_class_property_info.cpp 57 ./src/create_type_help_items.cpp 58 ./src/script_element_kind.cpp 59 ./src/signature_help_items.cpp 60 ./src/signature_help.cpp 61 ./src/todo_comments.cpp 62 ./src/get_definition_and_bound_span.cpp 63 ./src/types.cpp 64 ./src/navigate_to.cpp 65 ./src/code_fix_provider.cpp 66 ./src/register_code_fix/add_missing_declare_property.cpp 67 ./src/register_code_fix/fix_missing_call_parantheses.cpp 68 ./src/register_code_fix/fix_nan_equality.cpp 69 ./src/register_code_fix/forgetten_this_property_access.cpp 70 ./src/register_code_fix/import_fixes.cpp 71 ./src/register_code_fix/ui_plugin_suggest.cpp 72 ./src/get_name_or_dotted_name_span.cpp 73) 74 75panda_add_library(${LSP_LIB} SHARED ${ES2PANDA_LSP_SRC}) 76 77panda_target_include_directories(${LSP_LIB} 78 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include 79 PRIVATE ${ES2PANDA_ROOT} 80 PRIVATE ${OUTPUT_DIR} 81) 82 83panda_target_compile_options(${LSP_LIB} 84 PRIVATE -fexceptions -Werror=shadow 85) 86 87panda_target_link_libraries(${LSP_LIB} 88 PUBLIC arkbase es2panda-lib es2panda-public 89 PRIVATE arkbytecodeopt 90) 91 92panda_add_sanitizers(TARGET ${LSP_LIB} SANITIZERS 93 ${PANDA_SANITIZERS_LIST}) 94