GithubHelp home page GithubHelp logo

mrpilot2 / cmake Goto Github PK

View Code? Open in Web Editor NEW

This project forked from artsiomch/cmake

0.0 1.0 0.0 1.63 MB

IntelliJ Platform plugin for CMake basic syntax highlight.

Home Page: https://plugins.jetbrains.com/plugin/10089-cmake-simple-highlighter

License: GNU General Public License v3.0

Lex 1.73% Java 67.90% CMake 30.37%

cmake's Introduction

CMake plugin for IntelliJ Idea CE and Android Studio

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

  • Basic syntax highlight for IntelliJ IDEA CE and Android Studio.
  • Extend existed highlighting in CLion.

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

  • Finally :) tested fix of CLion 2018.2 EAP compatibility issue.

v.0.2.3

  • Fixed (but not tested) upcoming CLion 2018.2 EAP compatibility issue: CPP-12728.

v.0.2.2

  • Fixed compatibility for upcoming Android Studio 3.2 (with restricted functionality as for CLion). As a side effect the Plugin become open for all IntelliJ Platform's IDEs.

v.0.2.1

  • Fixed Android Studio compatibility issue.

v.0.2.0

  • Variable declarations/references navigation (IDEA/Android studio only: Ctrl+B, Alt+F7, Ctrl+Click, etc.), renaming (IDEA/Android studio only: Shift+F6) and highlighting (IDEA/Android studio and partially CLion).

v.0.1.0

  • CLion support added.

v.0.0.3

  • BraceMatcher added.

v.0.0.2

  • Bug of not evaluating escaped escape symbol \\ inside quoted argument fixed.

v.0.0.1

  • Supports basic syntax highlight.

Build Instruction

  • To get started you need the IntelliJ Plugin development SDK, Grammar-Kit plugin (to build parser and lexer from bnf grammar)

  • Download the code, set Plugin SDK and Java SDK

  • In project properties set the plugin.xml location (resources/META-INF/plugin.xml)

  • Hover the cmake_v3.bnf and generate parser code

  • In project properties mark gen as source folder

  • Generate lexer class from CMake_org_v3.flex file.

  • Link clion.jar (two of them actually: from CLion 181 and below, from Clion 182 and above) to project as provided module or just create a stub at CMakeProxyToJB.java

  • Build project and you are set to go

cmake's People

Contributors

artsiomch avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.