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

Detect Definitions in {project_root}/cmake/XYZ.cmake

Open 3ddiddE opened this issue 2 years ago • 2 comments

I am using the coc.nvim client and I have a CMakeLists.txt which includes a helper.cmake (e.g. include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/CMakeHelper.cmake) ) file to define macros. I would like to be able to jump to the definition of these macros. I know that this is possible with ctags. Is there a way to use the language-server to jump to such a macro definition instead?

3ddiddE avatar Jul 06 '22 13:07 3ddiddE

Sorry, the plugin clearly says that the "definition provider is not found". So this would be kind of a feature request or a question about your workflow. Do you use ctags for this (if you want to inspect macros at all)?

3ddiddE avatar Jul 06 '22 13:07 3ddiddE

CMake provides no API to get function/macro information. So I gave up at this time (ref #15). However, it is practical to use ctags together. I usually use neovim with multiple LSPs and ctags.

regen100 avatar Jul 23 '22 19:07 regen100