ArtsiomCh / CMake

IntelliJ Platform plugin for CMake basic syntax highlight.
https://plugins.jetbrains.com/plugin/10089-cmake-simple-highlighter
GNU General Public License v3.0
44 stars 7 forks source link

CMake plugin for IntelliJ Idea CE and Android Studio

This is the plugin for CMake syntax highlight support. It provides:

The main goal was to make CMakeLists.txt files more readable in Android Studio. It is my play project to study intellij language support. Please see JetBrains manual for more details. Work is still in progress.

Plugin is inspired and based on CMaker by Aliaksandr Dubrouski

CMake Syntax from cmake.org is mostly implemented.

Till version 0.1.0 IntelliJ IDEA CE and Android Studio: Commands, Variables, Property and Operator was taken from vim CMake support pluging
For CLion and from version 0.2.0 for IntelliJ IDEA CE and Android Studio: Commands, Variables, Property and Operator was taken from official cmake.org manuals.

Variable declaration and usage panels (only IDEA and Android studio(till 3.2): Ctrl+B, Alt+F7, Ctrl+Click, etc.) show all visible mentions of the variable name in ALL Project's cmake files. Scope principles (function, directory, etc.) not yet implemented. Use it for guidance only not for determining variable visibility. Variable reference's specific case inside IF and WHILE conditions implemented.

Navigation between variable's declarations/references in CLion is not implemented. Might be implemented in future releases.

ENV variables navigation/renaming is not implemented yet. Nevertheless ENV variables highlighting works.

Variable's rename refactoring (Shift+F6) works fine for variables with single declaration. For multi declared (re-declared, amended) variables rename refactoring works only from variable declaration side (i.e. caret should be on variable declaration, not reference) and will change all visible references and only current declaration. use with caution, it looks for me like a bug (feature?) of IDEA.

Till version 0.1.0 IntelliJ IDEA CE and Android Studio there are few known syntax highlights bugs, mostly around $ symbol, because it's used to recognise Variable references in arguments. But those bugs could be reproduced mostly on synthetic tests while real CMakeLists.txt files shown correctly.

In case you don't need such a detailed highlight (i.e. it looks too motley) you can always change colors at plugin settings.

Binary

Plugin was already submitted and approved in JetBrains Plugins Repository and is available in search results at Settings|Plugins|Browse repositories.

If you wish to use compiled version of pluging, please take CMake.jar from the root dir of that project and place file to the <YOUR_IntelliJ_IDE>\config\plugins folder (where to find it), and then restart your IDE so the changes may take effect. More details at JetBrains manual.

License

Plugin is open-source software and is licenced under GPL v3 licence.

Versions

v.0.2.4

v.0.2.3

v.0.2.2

v.0.2.1

v.0.2.0

v.0.1.0

v.0.0.3

v.0.0.2

v.0.0.1

Build Instruction