Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for metal shading language #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Marketplace Version](https://vsmarketplacebadge.apphb.com/version/xaver.clang-format.svg)](https://marketplace.visualstudio.com/items?itemName=xaver.clang-format)
[![Installs](https://vsmarketplacebadge.apphb.com/installs/xaver.clang-format.svg)](https://marketplace.visualstudio.com/items?itemName=xaver.clang-format)

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


## Usage
Expand Down
21 changes: 19 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"Clang",
"LLVM",
"Protobuf",
"CUDA"
"CUDA",
"Metal"
],
"main": "./out/src/extension",
"activationEvents": [
Expand All @@ -43,7 +44,8 @@
"onLanguage:glsl",
"onLanguage:hlsl",
"onLanguage:cuda",
"onLanguage:cuda-cpp"
"onLanguage:cuda-cpp",
"onLanguage:metal"
],
"contributes": {
"configuration": {
Expand Down Expand Up @@ -305,6 +307,21 @@
"default": "",
"description": "clang-format fallback style for CUDA, left empty to use clang-format.fallbackStyle"
},
"clang-format.language.metal.enable": {
"type": "boolean",
"default": true,
"description": "enable formatting for Metal Shader Files"
},
"clang-format.language.metal.style": {
"type": "string",
"default": "",
"description": "clang-format fallback style for Metal Shader Files, left empty to use clang-format.style"
},
"clang-format.language.metal.fallbackStyle": {
"type": "string",
"default": "",
"description": "clang-format fallback style for Metal Shader Files, left empty to use clang-format.fallbackStyle"
},
"clang-format.assumeFilename": {
"type": "string",
"default": "",
Expand Down
2 changes: 1 addition & 1 deletion src/clangMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const ALIAS = {
};

let languages: string[] = [];
for (let l of ['cpp', 'c', 'csharp', 'objective-c', 'objective-cpp', 'java', 'javascript', 'json', 'typescript', 'proto', 'proto3', 'textproto', 'apex', 'glsl', 'hlsl', 'cuda', 'cuda-cpp']) {
for (let l of ['cpp', 'c', 'csharp', 'objective-c', 'objective-cpp', 'java', 'javascript', 'json', 'typescript', 'proto', 'proto3', 'textproto', 'apex', 'glsl', 'hlsl', 'cuda', 'cuda-cpp', 'metal']) {
let confKey = `language.${ALIAS[l] || l}.enable`;
if (vscode.workspace.getConfiguration('clang-format').get(confKey)) {
languages.push(l);
Expand Down