├── README.md └── cmake-vscode.png /README.md: -------------------------------------------------------------------------------- 1 | # CMake Language Support 2 | 3 | CMake Language Support implements all of your favorite code editor features and is currently available for Visual Studio Code. An interactive preview is available at https://josetr.github.io/cmake-language-support. 4 | 5 | Please note that we do our best to get most of the command signatures and parameters by scanning the whole CMake Documentation but it's currently impossible to be 100% accurate due to the nature of the documentation. 6 | 7 | [![CI](cmake-vscode.png)](cmake-vscode.png) 8 | 9 | ## Features 10 | 11 | - Syntax Highlighting 12 | - Auto Completion 13 | - Quick Info 14 | - Signature Help 15 | - Syntax Errors / Warnings 16 | - Format Document 17 | - Format Selection 18 | - Rename Symbol 19 | - Comment Line / Block 20 | - Document Symbols 21 | - Document Highlights 22 | - Folding Ranges 23 | - Go to Definition 24 | - Go to References 25 | - Find All References 26 | - Brace Completion 27 | - Brace Matching 28 | - Brace Surrounding 29 | - Smart Indentation 30 | 31 | ### Installing .NET 6 Runtime (required) 32 | 33 | #### Automatic 34 | 35 | [Microsoft's .NET Install Tool for Extension Authors](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.vscode-dotnet-runtime) will be used to acquire a **.NET Runtime** automagically once the extension runs for the first time. If it fails, as seems to be the case for some users, please follow the **manual** installation instructions. 36 | 37 | #### Manual 38 | 39 | - Install .NET Runtime 40 | - Windows: https://learn.microsoft.com/en-us/dotnet/core/install/windows 41 | - Linux: https://learn.microsoft.com/en-us/dotnet/core/install/linux 42 | - macOS: https://learn.microsoft.com/en-us/dotnet/core/install/macos 43 | - Set `cmake.languageSupport.dotnetPath` to your dotnet executable path (usually `C:/Program Files/dotnet/dotnet.exe` on Windows) 44 | 45 | ### Configuration 46 | 47 | #### Format Options 48 | 49 | | cmake.format.[option] | false (default) | true | 50 | | --------------------- | --------------- | -------------- | 51 | | spaceAfterCommandName | message() | message () | 52 | | spaceInParentheses | message(arg) | message( arg ) | 53 | 54 | - allowOptionalArgumentIndentation 55 | ```cmake 56 | # false (default) true 57 | message( message( 58 | WARNING WARNING 59 | msg msg # manually added indentation will be kept 60 | ) ) 61 | ``` 62 | 63 | #### FileAPI (Experimental) 64 | 65 | Enables experimental use of https://cmake.org/cmake/help/git-stage/manual/cmake-file-api.7.html in order to provide more accurate results. 66 | 67 | - Install Microsoft's [CMake Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) extension 68 | - Set `cmake.languageSupport.enableFileAPI` to `true`. 69 | 70 | Every time `CMake Tools` configures the active cmake project (usually when you save a CMakeLists.txt file), our `cmake-file-api` query will be executed and we will be able to: 71 | 72 | 1. Provide accurate results for: 73 | 74 | - Targets 75 | - Configurations 76 | - Toolchains 77 | 78 | 2. Get the exact cmake files used by the cmake project and parse them all in order to: 79 | - Search user-declared functions, macros, and variables in all files 80 | - Enable the following features to work across all of the available files 81 | - Find All References 82 | - Go to Definition 83 | - Workspace Symbols 84 | - Auto Completion 85 | - Signature Help 86 | - Quick Info 87 | -------------------------------------------------------------------------------- /cmake-vscode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josetr/cmake-language-support/0f672c02d3586725b7e576b4c7b9f147ed0be46d/cmake-vscode.png --------------------------------------------------------------------------------