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

intellisense for declarations from an `include()`

Open david-fong opened this issue 2 years ago • 4 comments

I'm not sure to what degree declarations from include()s are already added to intellisense, but I've noticed some things not being added. For example,

  • FetchContent_Declare after include(FetchContent)
  • generate_export_header after include(GenerateExportHeader)
  • ${CMAKE_INSTALL_INCLUDEDIR} after include(GNUInstallDirs)

Are there things that make something like this difficult to support?

david-fong avatar Aug 08 '22 17:08 david-fong

Even with cmake.languageSupport.enableFileAPI=True, CMake Tools extension installed, and after a successful CMake configuration, functions, macros & variables coming from an include() don't have any syntax highlighting nor autocompletion.

At least in include() command, there is an autocompletion & syntax highlighting of CMake bundled module files (but not for custom module files of a project, I would have expected something like traversing CMAKE_MODULE_PATH and look at additional CMake module files in these directories).

SpaceIm avatar Oct 20 '22 19:10 SpaceIm

Please add this. This would be very helpful. Per documentation, FetchContent_Declare() takes "any of the download, update or patch options that the ExternalProject_Add". That should be very easy to add.

alexchandel avatar Feb 13 '23 23:02 alexchandel

Indeed. cmake_dependent_option() similarly from include(CMakeDependentOption). However it would be awesome if documentation of custom packages with built CMake documentation could be displayed similarly, thinking of project-specific modules that have CMake-like documentation built, such as rocm-cmake used throughout the ROCm ecosystem.

MathiasMagnus avatar Sep 27 '23 15:09 MathiasMagnus

Any updates on this? I tried using "cmake.languageSupport.enableFileAPI": true but functions obtained from include() are not highlighted until the include file is selected.

billgan1024 avatar Dec 31 '23 16:12 billgan1024