All Projects → xaverh → Vscode Clang Format Provider

xaverh / Vscode Clang Format Provider

Licence: mit
A Visual Studio Code extension that provides C++, C, Obj-C, Java formatting with the use of clang-format

Programming Languages

typescript
32286 projects

Labels

Projects that are alternatives of or similar to Vscode Clang Format Provider

Vscode Rss
An RSS reader embedded in Visual Studio Code
Stars: ✭ 102 (-8.93%)
Mutual labels:  vscode
Flowmaker
flowmaker: JS to SVG flowchart generation extension for Vscode in realtime written in typescript and also download the SVG through local node server. Extension:
Stars: ✭ 108 (-3.57%)
Mutual labels:  vscode
Vscode
Unibeautify for VSCode
Stars: ✭ 110 (-1.79%)
Mutual labels:  vscode
Vscode Yuml
yUML extension for Visual Studio Code
Stars: ✭ 102 (-8.93%)
Mutual labels:  vscode
Code Server
VS Code in the browser
Stars: ✭ 50,541 (+45025.89%)
Mutual labels:  vscode
Acme Assembly Vscode Template
A template for compiling 6502 assembly code with ACME in VSCode
Stars: ✭ 109 (-2.68%)
Mutual labels:  vscode
Dotfiles
Awesome personal dotfiles
Stars: ✭ 99 (-11.61%)
Mutual labels:  vscode
Ubuntu On Steroids
Developer setup & configuration guide for Ubuntu.
Stars: ✭ 111 (-0.89%)
Mutual labels:  vscode
Vscode Solidity Auditor
Solidity language support and visual security auditor for Visual Studio Code
Stars: ✭ 108 (-3.57%)
Mutual labels:  vscode
Vscode Js Annotations
Javascript / Typescript Parameter Annotations for Visual Studio Code
Stars: ✭ 110 (-1.79%)
Mutual labels:  vscode
Vscode Mdx Preview
MDX Preview for Visual Studio Code
Stars: ✭ 103 (-8.04%)
Mutual labels:  vscode
Openfolderinvscode
With this macOS service, you can quickly open any given folder as a project in Visual Studio Code from the Finders context menu.
Stars: ✭ 105 (-6.25%)
Mutual labels:  vscode
Seed
Go application GitHub repository template.
Stars: ✭ 109 (-2.68%)
Mutual labels:  vscode
Laserwave
A retro outrun / cyberpunk inspired VS Code theme
Stars: ✭ 102 (-8.93%)
Mutual labels:  vscode
I18n Ally
🌍 All in one i18n extension for VS Code
Stars: ✭ 1,931 (+1624.11%)
Mutual labels:  vscode
Foam
A personal knowledge management and sharing system for VSCode
Stars: ✭ 10,993 (+9715.18%)
Mutual labels:  vscode
Github Vsc
🐙 Launch VSCode dev environment in your browser.
Stars: ✭ 108 (-3.57%)
Mutual labels:  vscode
Vscode Mermaid Preview
Previews Mermaid diagrams
Stars: ✭ 111 (-0.89%)
Mutual labels:  vscode
Vscode Azure Blockchain Ethereum
Blockchain extension for VS Code
Stars: ✭ 111 (-0.89%)
Mutual labels:  vscode
Vscode Ptt
在 VSCode 瀏覽 PTT!
Stars: ✭ 110 (-1.79%)
Mutual labels:  vscode

README

Clang-Format is a tool to format C/C++/Java/JavaScript/Objective-C/Objective-C++/Protobuf code. It can be configured with a config file within the working folder or a parent folder. Configuration see: http://clang.llvm.org/docs/ClangFormatStyleOptions.html

Usage

This extension allows clang-format (version 3.8 or higher) to be used to format C/C++, Javascript etc. source files directly from within Visual Studio Code.

Files can be formatted on-demand by right clicking in the document and selecting "Format Document", or by using the associated keyboard shortcut (usually Ctrl+⇧+F on Windows, Ctrl+⇧+I on Linux, and ⇧+⌥+F on macOS).

To automatically format a file on save, add the following to your vscode settings.json file:

{
    "editor.formatOnSave": true
}

Specifying the location of clang-format

This extension will attempt to find clang-format on your PATH. Alternatively, the clang-format executable can be specified in your vscode settings.json file:

{
    "clang-format.executable": "/absolute/path/to/clang-format"
}

Placeholders can also be used in the clang-format.executable value. The following placeholders are supported:

  • ${workspaceRoot} - replaced by the absolute path of the current vscode workspace root.
  • ${workspaceFolder} - replaced by the absolute path of the current vscode workspace. In case of outside-workspace files ${workspaceFolder} expands to the absolute path of the first available workspace.
  • ${cwd} - replaced by the current working directory of vscode.
  • ${env.VAR} - replaced by the environment variable $VAR, e.g. ${env.HOME} will be replaced by $HOME, your home directory.

Some examples:

  • ${workspaceRoot}/node_modules/.bin/clang-format - specifies the version of clang that has been added to your workspace by npm install clang-format.
  • ${env.HOME}/tools/clang38/clang-format - use a specific clang format version under your home directory.

Placeholders are also supported in clang-format.assumeFilename. The supported placeholders are ${file}, ${fileNoExtension}, ${fileBasename}, ${fileBasenameNoExtension}, and ${fileExtname}, with the same meaning as the predefined variables in other configuration files.

For example:

  • ${fileNoExtension}.cpp - /home/src/foo.h will be formatted with -assume-filename /home/src/foo.cpp.

Source code

Available on github: https://github.com/xaverh/vscode-clang-format-provider

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].