Plugin for (extra) CMake syntax highlight support.
- It provides(extends) syntax highlight for:
* Known Cmake command name;
* Utility Modules command name;
* User defined function name reference and definition;
* User defined macros name reference and definition;
* Bracket argument;
* Quoted argument.
- Highlighting styles are customisable at Settings -> Editor -> Color Scheme -> CMake [additional syntax].
Important Announcement
Starting from version 223.0 highlighting of command arguments is moved to CMake Plus plugindue to internal changes and implementation of more sophisticated command parameters recognition.
Please consider CMake Plus plugin for more functionality:
- Highlighting/recognition (on top of CMake simple highlighter) of such command arguments as:
* Variable's reference and definition (user-defined and cmake built-in);
* Properties (user-defined and cmake built-in);
* Targets reference and definition;
* Module's names;
* Command's named parameters (aka keyword arguments) for Scripting, Project and Utility Modules commands;
* Generator expressions;
* Path or Url structures;
* Policies (CMP<NNNN>).
- Variables, Properties and Targets navigation: Go to definition / Find usages (*see Notes).
- Variables, Properties and Targets completion (no scope recognition yet).
- Completion and quick-docs for variables, commands and it's parameters of Scripting Commands,Project Commands andUtility Modules commands (other commands support coming).
- Generator expressions quick docs and completion (no semantic rules yet).
- Parameters infofor Scripting, Project and Utility Modules commands (use Ctrl/Cmd + P
).
- Inlay Hints for Scripting, Project and Utility Modules command parameters (could be customised/disabled in Settings);
- Regex language injection is implemented based on command's signatures:highlighting and inspections provided by IDE built-in Regex language support;
- Folding regions for functions, macros, if/for/while blocks (pre-2022.3) and:
* Multiline brackets comments (pre-2022.3);
* Consequent single-line comments (pre-2022.3);
* Multiline function's arguments.
- "Comment with Line / Block Comment" (Ctrl + /
and Shift + Ctrl + /
) actions (pre-2022.3).
- Structure View (for the current file) with:
* Function/Macros declarations;
* Variable (re)definitions;
* Properties (re)definitions;
* Targets definitions;
* Filtering by Functions, Macros, Variables, Properties, Targets and Sorting alphabetical;
* Navigation in both directions (Structure View <-> Editor).
- Quick Documentation for CMake commands, modules, policies, properties, and variables. Clion's (or other IntelliJ IDE with built-in CMake support) Quick Docs priority given.
- Syntax and Operation inspections:
* Variable is set but never used;
* Usage of possibly not defined Variable;
* Builtin commands should be used in lowercase;
* End-of-block commands (else, endif, etc.) should not take arguments.
* Modules
and Module's commands
name case.
* Usage of CMake reserves identifiers.
* Unrecognized parameter by command signature.
* More parameters required by command signature.
- Edit | Extend/Shrink Selection for Variables and Generator expressions
- External Formatter integration added: developed for and tested with cheshirekow/cmake_format
See Visual Overview for more details and screenshots.