Skip to content

Commit adae177

Browse files
hvdijktstellar
authored andcommitted
Make clangd CompletionModel not depend on directory layout.
The current code accounts for two possible layouts, but there is at least a third supported layout: clang-tools-extra may also be checked out as clang/tools/extra with the releases, which was not yet handled. Rather than treating that as a special case, use the location of CompletionModel.cmake to handle all three cases. This should address the problems that prompted D96787 and the problems that prompted the proposed revert D100625. Reviewed By: usaxena95 Differential Revision: https://reviews.llvm.org/D101851 (cherry picked from commit 7907c46)
1 parent 3be5dbb commit adae177

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang-tools-extra/clangd/quality/CompletionModel.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
# ${CMAKE_CURRENT_BINARY_DIR}. The generated header
55
# will define a C++ class called ${cpp_class} - which may be a
66
# namespace-qualified class name.
7+
set(CLANGD_COMPLETION_MODEL_COMPILER ${CMAKE_CURRENT_LIST_DIR}/CompletionModelCodegen.py)
78
function(gen_decision_forest model filename cpp_class)
8-
set(model_compiler ${LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR}/clangd/quality/CompletionModelCodegen.py)
9+
set(model_compiler ${CLANGD_COMPLETION_MODEL_COMPILER})
910

1011
set(output_dir ${CMAKE_CURRENT_BINARY_DIR})
1112
set(header_file ${output_dir}/${filename}.h)

0 commit comments

Comments
 (0)