cmake-language-server icon indicating copy to clipboard operation
cmake-language-server copied to clipboard

Support functions in separated cmake modules

Open regen100 opened this issue 5 years ago • 2 comments

Examples:

  • find_package_handle_standard_args in FindPackageHandleStandardArgs
  • find_package_message in FindPackageMessage
  • cmake_dependent_option in CMakeDependentOption

regen100 avatar May 16 '20 07:05 regen100

This language server should also complete function-calls previously defined with function() ... endfunction().

rwols avatar Jun 07 '20 15:06 rwols

Short answer: The completion of the user defined functions is difficult. I'm not planning to support it at the moment.

Long answer: CMake is not providing any API to get function information. To get complete information of functions, parsing CMake scripts and simulating them are needed. It is roughly equivalent to making a copy of CMake. I gave up on it and took another approach which is to parsing the CMake document. It provides limited but useful information of the builtin functions. Therefore, the current implementation of LSP cannot handle user-defined function.

regen100 avatar Jun 10 '20 15:06 regen100