regen100 / cmake-language-server

CMake LSP Implementation
MIT License
331 stars 25 forks source link

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

Open 3ddiddE opened 2 years ago

3ddiddE commented 2 years ago

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 commented 2 years ago

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)?

regen100 commented 2 years ago

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.