├── .github └── workflows │ ├── build-vsix.yml │ ├── publish.yml │ └── sync-issues-to-project.yml ├── .gitignore ├── .reuse └── dep5 ├── .vscode └── launch.json ├── .vscodeignore ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── LICENSES ├── Apache-2.0.txt ├── CC-BY-4.0.txt ├── LLVM-exception.txt └── MIT.txt ├── README.md ├── build-package.sh ├── client └── src │ └── extension.ts ├── doc ├── auto-complete.gif └── goto-def.gif ├── images └── icon.png ├── language-configuration.json ├── package.json ├── syntaxes └── slang.tmLanguage.json └── tsconfig.json /.github/workflows/build-vsix.yml: -------------------------------------------------------------------------------- 1 | name: Build VSIX 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2.3.4 12 | with: 13 | submodules: 'true' 14 | fetch-depth: '0' 15 | - name: Download artifact - windows-x86_64 16 | id: download-windows-x86_64 17 | uses: dsaltares/fetch-gh-release-asset@master 18 | with: 19 | repo: shader-slang/slang 20 | file: 'slang-.*-windows-x86_64\.zip' 21 | target: "./" 22 | regex: true 23 | - name: Download artifact - windows-aarch64 24 | id: download-windows-aarch64 25 | uses: dsaltares/fetch-gh-release-asset@master 26 | with: 27 | repo: shader-slang/slang 28 | file: 'slang-.*-windows-aarch64\.zip' 29 | target: "./" 30 | regex: true 31 | - name: Download artifact - linux-x86_64 32 | id: download-linux-x86_64 33 | uses: dsaltares/fetch-gh-release-asset@master 34 | with: 35 | repo: shader-slang/slang 36 | file: 'slang-.*-linux-x86_64\.zip' 37 | target: "./" 38 | regex: true 39 | - name: Download artifact - linux-aarch64 40 | id: download-linux-aarch64 41 | uses: dsaltares/fetch-gh-release-asset@master 42 | with: 43 | repo: shader-slang/slang 44 | file: 'slang-.*-linux-aarch64\.zip' 45 | target: "./" 46 | regex: true 47 | - name: Download artifact - macos-x86_64 48 | id: download-macos-x86_64 49 | uses: dsaltares/fetch-gh-release-asset@master 50 | with: 51 | repo: shader-slang/slang 52 | file: 'slang-.*-macos-x86_64\.zip' 53 | target: "./" 54 | regex: true 55 | - name: Download artifact - macos-aarch64 56 | id: download-macos-aarch64 57 | uses: dsaltares/fetch-gh-release-asset@master 58 | with: 59 | repo: shader-slang/slang 60 | file: 'slang-.*-macos-aarch64\.zip' 61 | target: "./" 62 | regex: true 63 | - name: Copy Slang binaries and Build VSIX 64 | run: | 65 | export TAGNAME=${{ steps.download-windows-x86_64.outputs.version }} 66 | export WIN32_X64_ZIP=slang-${TAGNAME:1}-windows-x86_64.zip 67 | export WIN32_ARM64_ZIP=slang-${TAGNAME:1}-windows-aarch64.zip 68 | export LINUX_X64_ZIP=slang-${TAGNAME:1}-linux-x86_64.zip 69 | export LINUX_ARM64_ZIP=slang-${TAGNAME:1}-linux-aarch64.zip 70 | export DARWIN_X64_ZIP=slang-${TAGNAME:1}-macos-x86_64.zip 71 | export DARWIN_ARM64_ZIP=slang-${TAGNAME:1}-macos-aarch64.zip 72 | source build-package.sh 73 | 74 | for file in ./*.vsix 75 | do 76 | echo "Built VSIX: $file" 77 | done 78 | - uses: actions/upload-artifact@v4 79 | with: 80 | name: slang-vsix 81 | path: | 82 | *.vsix -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish VSIX - GitHub 2 | 3 | on: 4 | push: 5 | tags: 6 | - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v2.3.4 13 | with: 14 | submodules: 'true' 15 | fetch-depth: '0' 16 | - name: Download artifact - windows-x86_64 17 | id: download-windows-x86_64 18 | uses: dsaltares/fetch-gh-release-asset@master 19 | with: 20 | repo: shader-slang/slang 21 | file: 'slang-.*-windows-x86_64\.zip' 22 | target: "./" 23 | regex: true 24 | - name: Download artifact - windows-aarch64 25 | id: download-windows-aarch64 26 | uses: dsaltares/fetch-gh-release-asset@master 27 | with: 28 | repo: shader-slang/slang 29 | file: 'slang-.*-windows-aarch64\.zip' 30 | target: "./" 31 | regex: true 32 | - name: Download artifact - linux-x86_64 33 | id: download-linux-x86_64 34 | uses: dsaltares/fetch-gh-release-asset@master 35 | with: 36 | repo: shader-slang/slang 37 | file: 'slang-.*-linux-x86_64\.zip' 38 | target: "./" 39 | regex: true 40 | - name: Download artifact - linux-aarch64 41 | id: download-linux-aarch64 42 | uses: dsaltares/fetch-gh-release-asset@master 43 | with: 44 | repo: shader-slang/slang 45 | file: 'slang-.*-linux-aarch64\.zip' 46 | target: "./" 47 | regex: true 48 | - name: Download artifact - macos-x86_64 49 | id: download-macos-x86_64 50 | uses: dsaltares/fetch-gh-release-asset@master 51 | with: 52 | repo: shader-slang/slang 53 | file: 'slang-.*-macos-x86_64\.zip' 54 | target: "./" 55 | regex: true 56 | - name: Download artifact - macos-aarch64 57 | id: download-macos-aarch64 58 | uses: dsaltares/fetch-gh-release-asset@master 59 | with: 60 | repo: shader-slang/slang 61 | file: 'slang-.*-macos-aarch64\.zip' 62 | target: "./" 63 | regex: true 64 | - name: Copy Slang binaries and Build VSIX 65 | run: | 66 | export TAGNAME=${{ steps.download-windows-x86_64.outputs.version }} 67 | export WIN32_X64_ZIP=slang-${TAGNAME:1}-windows-x86_64.zip 68 | export WIN32_ARM64_ZIP=slang-${TAGNAME:1}-windows-aarch64.zip 69 | export LINUX_X64_ZIP=slang-${TAGNAME:1}-linux-x86_64.zip 70 | export LINUX_ARM64_ZIP=slang-${TAGNAME:1}-linux-aarch64.zip 71 | export DARWIN_X64_ZIP=slang-${TAGNAME:1}-macos-x86_64.zip 72 | export DARWIN_ARM64_ZIP=slang-${TAGNAME:1}-macos-aarch64.zip 73 | source build-package.sh 74 | 75 | for file in ./*.vsix 76 | do 77 | echo "Built VSIX: $file" 78 | done 79 | - uses: actions/cache/save@v4 80 | id: cache 81 | with: 82 | path: ./*.vsix 83 | key: cache-${{ github.run_id }}-${{ github.run_attempt }} 84 | 85 | publish-github: 86 | runs-on: ubuntu-latest 87 | needs: build 88 | steps: 89 | - uses: actions/cache/restore@v4 90 | id: cache 91 | with: 92 | path: ./*.vsix 93 | key: cache-${{ github.run_id }}-${{ github.run_attempt }} 94 | fail-on-cache-miss: true 95 | - name: UploadSource 96 | uses: softprops/action-gh-release@v1 97 | with: 98 | files: | 99 | *.vsix 100 | env: 101 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 102 | 103 | publish-vscode: 104 | runs-on: ubuntu-latest 105 | needs: build 106 | steps: 107 | - uses: actions/cache/restore@v4 108 | id: cache 109 | with: 110 | path: ./*.vsix 111 | key: cache-${{ github.run_id }}-${{ github.run_attempt }} 112 | fail-on-cache-miss: true 113 | - name: Publish VSIX package to Visual Studio Marketplace 114 | env: 115 | VSCE_TOKEN: ${{ secrets.VS_MARKETPLACE_TOKEN }} 116 | run: | 117 | npm install -g @vscode/vsce 118 | 119 | for file in ./*.vsix 120 | do 121 | vsce publish -p "$VSCE_TOKEN" --packagePath "$file" 122 | echo "Published VSIX: $file" 123 | done 124 | -------------------------------------------------------------------------------- /.github/workflows/sync-issues-to-project.yml: -------------------------------------------------------------------------------- 1 | name: Sync issues with the Slang project 2 | 3 | on: 4 | issues: 5 | types: 6 | - opened 7 | 8 | jobs: 9 | add-to-project: 10 | name: Add issue to project 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/add-to-project@v1.0.2 14 | with: 15 | project-url: https://github.com/orgs/shader-slang/projects/10 16 | github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.vsix 2 | .vscode/ 3 | node_modules/ 4 | package-lock.json 5 | out/ 6 | bin/ 7 | *.zip 8 | -------------------------------------------------------------------------------- /.reuse/dep5: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: Slang Shading Language VSCode Extension 3 | Upstream-Contact: The Khronos Group, Inc. 4 | Source: https://github.com/shader-slang/slang-vscode-extension 5 | 6 | Files: * 7 | Copyright: 2016, Carnegie Mellon University and NVIDIA Corporation 8 | 2024 The Khronos Group, Inc. 9 | License: Apache-2.0 WITH LLVM-exception 10 | 11 | Files: client/src/extension.ts 12 | Copyright: Microsoft Corporation 13 | License: MIT 14 | 15 | Files: README.md 16 | CODE_OF_CONDUCT.md 17 | CONTRIBUTING.md 18 | Copyright: 2024 The Khronos Group, Inc. 19 | License: CC-BY-4.0 20 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that launches the extension inside a new window 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | { 6 | "version": "0.2.0", 7 | "configurations": [ 8 | { 9 | "name": "Extension", 10 | "type": "extensionHost", 11 | "request": "launch", 12 | "args": [ 13 | "--extensionDevelopmentPath=${workspaceFolder}" 14 | ] 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .gitignore 2 | .vscode 3 | .github 4 | node_modules/ 5 | artifacts/ 6 | src/ 7 | out/ 8 | client/ 9 | tmp/ 10 | !client/out/main.js 11 | tsconfig.json 12 | webpack.config.js 13 | *.zip 14 | *.vsix 15 | *.map 16 | *.md 17 | *.sh 18 | **/*.gif 19 | !CHANGELOG.md 20 | !README.md -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | # v1.9.10 3 | - Update to Slang v2025.10.1. 4 | 5 | # v1.9.9 6 | - Update to Slang v2025.6.1. 7 | 8 | # v1.9.6 9 | - Update to Slang v2025.4. 10 | 11 | # v1.9.5 12 | - Update to Slang v2025.3.3, with support to `CoopVec` type. 13 | 14 | ## v1.9.4 15 | - Update to Slang v2025.2. 16 | 17 | ## v1.9.3 18 | - Update to Slang v2024.17. 19 | 20 | ## v1.9.1 21 | - Update to Slang v2024.16. 22 | 23 | ## v1.9.0 24 | - Update to Slang v2024.15. 25 | 26 | ## v1.8.19 27 | - Update to Slang v2024.14.3. 28 | 29 | ## v1.8.18 30 | - Update to Slang v2024.11. 31 | 32 | ## v1.8.17 33 | - Update to Slang v2024.10 34 | 35 | ## v1.8.16 36 | - Update to Slang v2024.1.34. 37 | 38 | ## V1.8.15 39 | - Update to Slang v2024.1.30. 40 | 41 | ## v1.8.14 42 | - Update to Slang v2024.1.28. 43 | - Fix performance regression. 44 | 45 | ## v1.8.13 46 | - Update to Slang v2024.1.20. 47 | - Add syntax support for `if (let x = expr)`. 48 | 49 | ## v1.8.12 50 | - Update to Slang v2024.1.6 51 | - Fixes some parsing and lookup rules. 52 | 53 | ## v1.8.11 54 | - Update to Slang v2024.1.5 55 | - Parser fixes. 56 | 57 | ## v1.8.10 58 | - Update to Slang v2024.1.4 59 | - Type system fixes. 60 | 61 | ## v1.8.9 62 | - Update to Slang v2024.1.2. 63 | - Allow angle-bracket #include path. 64 | - Support unscoped enum types through the [UnscopedEnum] attribute. 65 | - Add diagnostic on invalid generic constraint type. 66 | 67 | ## v1.8.8 68 | - Update to Slang v2024.1.1. 69 | - Fix a compiler crash during constant folding. 70 | 71 | ## v1.8.7 72 | - Update to Slang v2024.1.0. 73 | - Add highlighting for `dynamic_uniform` keyword. 74 | 75 | ## v1.8.6 76 | - Update to Slang v2024.0.14. 77 | - Add support for bitfields. 78 | 79 | ## v1.8.5 80 | - Update to Slang v2024.0.10. 81 | - Robustness fixes. 82 | 83 | ## v1.8.4 84 | - Update to Slang v2024.0.5. 85 | - Pointer support. 86 | - Type checking fix around generic arrays. 87 | 88 | ## v1.8.3 89 | - Correctly highlight half literal suffix. 90 | 91 | ## v1.8.2 92 | - Update to Slang v2024.0.2. 93 | - Add support for capabilities. 94 | 95 | ## v1.8.1 96 | - Update to Slang v2023.5.4. 97 | - Add support for Source Engine shader files. 98 | 99 | ## v1.8.0 100 | - Update to Slang v2023.5.3. 101 | 102 | ## v1.7.26 103 | - Update to Slang v2023.5.2. 104 | - Improve namespace highlighting. 105 | - Add diagnostic for invalid modifier use. 106 | 107 | ## v1.7.25 108 | - Update to Slang v2023.5.1. 109 | - Namespace and module fixes. 110 | 111 | ## v1.7.24 112 | - Update to Slang v2023.5.0. 113 | - Add support for __include and access control. 114 | 115 | ## v1.7.23 116 | - Update to Slang v2023.4.10. 117 | - Fixes an issue where signature help fails to appear. 118 | 119 | ## v1.7.21 120 | - Update to Slang v2023.4.8. 121 | - Stability fixes. 122 | - Improves highlighting/hinting support around constructors. 123 | 124 | ## v1.7.20 125 | - Update to Slang v2023.4.6. 126 | 127 | ## v1.7.19 128 | - Switch to x64 on Windows. 129 | 130 | ## v1.7.18 131 | - Update to Slang v2023.4.5. 132 | 133 | ## v1.7.17 134 | - Update to Slang v2023.4.3. 135 | 136 | ## v1.7.16 137 | - Update to Slang v2023.3.20. 138 | 139 | ## v1.7.15 140 | - Update to Slang v2023.3.19. 141 | 142 | ## v1.7.13 143 | - Update grammar for `__target_switch`. 144 | 145 | ## v1.7.12 146 | - Update to Slang v2023.3.18 147 | - Add highlighting support for `spirv_asm`. 148 | 149 | ## v1.7.11 150 | - Update to Slang v2023.3.16 151 | 152 | ## v1.7.10 153 | - Update to Slang v2023.3.10 154 | 155 | ## v1.7.9 156 | - Update to Slang v2023.3.7 157 | - Highlighting `__target_switch`, `__intrinsic_asm`, `spirv_asm` keywords. 158 | 159 | ## v1.7.8 160 | - Update to Slang v2023.3.6 161 | - Fixes regressions. 162 | 163 | ## v1.7.6 164 | - Update to Slang v2023.3.5 165 | - Fix a crash during type checking. 166 | - Fix incorrect highlighting of attribute names with scope qualifiers. 167 | 168 | ## v1.7.5 169 | - Update to Slang v2023.3.4 170 | 171 | ## v1.7.4 172 | - Update to Slang v2023.1.0 173 | 174 | ## v1.7.3 175 | - Update to Slang v0.28.3 176 | 177 | ## v1.7.2 178 | - Update to Slang v0.28.1 179 | 180 | ## v1.7.1 181 | - Update to Slang v0.28.0 182 | 183 | ## v1.7.0 184 | - Update to Slang v0.27.21 185 | - Fix a crash when checking `for` loops. 186 | - Add support for finalized autodiff keywords. 187 | 188 | ## v1.6.10 189 | - Update to Slang v0.27.18 190 | - Improved intellisense for attribute arguments. 191 | 192 | ## v1.6.8 193 | - Update to Slang v0.27.16 194 | - Add hover info for attributes. 195 | - Show variable scope in hover info. 196 | - Show documentation for builtin decls. 197 | ## v1.6.7 198 | - Update to Slang v0.27.14 199 | - Fixed a crash when checking incomplete `typealias` declaration. 200 | 201 | ## v1.6.6 202 | - Update to Slang v0.27.9 203 | 204 | ## v1.6.5 205 | - Update to Slang v0.27.8 206 | - Added more diagnostics. 207 | 208 | ## v1.6.4 209 | - Update to Slang v0.27.7 210 | 211 | ## v1.6.3 212 | - Update to Slang v0.27.4 213 | 214 | ## v1.6.2 215 | - Update to Slang v0.27.3 216 | 217 | ## v1.6.1 218 | - Update to Slang v0.27.1 219 | 220 | ## v1.6.0 221 | - Update to Slang v0.27.0 222 | - Added support for new attributes and syntax for authoring PyTorch kernels. 223 | 224 | ## v1.5.13 225 | - Update to Slang v0.25.3. 226 | - Fixed an issue where breadcrumb AST nodes can mess up semantic highlighting and hover info. 227 | 228 | ## v1.5.12 229 | - Update to Slang v0.25.2. 230 | ## v1.5.11 231 | - Update to Slang v0.25.0. 232 | - Fixed a bug that causes hover info and goto definition to stop working when switching between document. 233 | 234 | ## v1.5.10 235 | - Update to Slang v0.24.54. 236 | 237 | ## v1.5.9 238 | - General bug fixes and update to Slang v0.24.53. 239 | 240 | ## v1.5.8 241 | - Update to Slang v0.24.47. 242 | 243 | ## v1.5.7 244 | - Added semantic highlighting for attributes. 245 | - Changed auto-format behavior to no longer insert space between `{}`. 246 | - Fixed an highlighting issue for interface-typed values. 247 | - Update to Slang v0.24.46. 248 | 249 | ## v1.5.6 250 | - Update to Slang v0.24.45 251 | 252 | ## v1.5.5 253 | - Improved parser recovery around unknown function modifiers. 254 | - Added keyword highlighting for auto-diff feature. 255 | - Update to Slang v0.24.44 256 | 257 | ## v1.5.4 258 | - Update to Slang v0.24.37, which brings experimental support for auto differentiation. 259 | - Add `slang.slangdLocation` configuration to allow the extension to use custom built language server. 260 | 261 | ## v1.5.3 262 | - Update to Slang v0.24.35, which brings support for `[ForceInline]`. 263 | 264 | ## v1.5.2 265 | - Update to Slang v0.24.34, which brings support for multi-level `break`. 266 | - Add missing highlighting for `uint` type. 267 | 268 | ## v1.5.1 269 | - Fix a crash when parsing entry-point functions that has type errors in the signature. 270 | 271 | ## v1.5.0 272 | - Release on Win-ARM64 and MacOS-ARM64. 273 | 274 | ## v1.4.7 275 | - Add `slang.format.clangFormatFallbackStyle` setting that will be used when `style` is `file` but a `.clang-format` file is not found. 276 | - Changed the default value of `slang.format.clangFormatStyle` to `file`. 277 | - The default value of `slang.format.clangFormatFallbackStyle` is set to `{BasedOnStyle: Microsoft, BreakBeforeBraces: Allman, ColumnLimit: 0}`. 278 | 279 | ## v1.4.6 280 | - Update to Slang v0.24.23, which brings support for `intptr_t`, `printf`, raw string literals and partial inference of generic arguments. 281 | - Add highlighting for raw string literals. 282 | 283 | ## v1.4.5 284 | - Update to Slang v0.24.15 to support the new builtin interfaces (`IArithmetic`, `IInteger`, `IFloat` etc.) 285 | - Add syntax highlighting for `half`. 286 | 287 | ## v1.4.4 288 | - Update to Slang v0.24.14 to support constant folding through interfaces (associated constants). 289 | 290 | ## v1.4.3 291 | - Update to Slang v0.24.13, which brings more powerful constant folding. 292 | - Allow deleting and retyping "," to trigger function signature info. 293 | 294 | ## v1.4.2 295 | - Update default Clang-format style to be more conservative on line-break changes. 296 | - Update Slang compiler version to v0.24.12 to support new language features. 297 | 298 | ## v1.4.1 299 | - Prevent "." and "-" from commiting `include` suggestions. 300 | - Add settings to disallow line-break changes in auto formatting. 301 | - Format on paste no longer changes lines after the cursor position. 302 | - Fix auto indentation after typing `{` following `if`, `while`, and `for`. 303 | 304 | ## v1.4.0 305 | - Support auto completion for `include` and `import` paths. 306 | - Display formatted doxygen comments in hover info. 307 | - Reduced package size. 308 | 309 | ## v1.3.3 310 | - Fine tuned code completion triggering conditions. 311 | - Add configurations to turn on/off each individual type of inlay hints. 312 | - Fixed a regression that caused the commit character configuration to have no effect. 313 | 314 | ## v1.3.2 315 | - Update default clang-format style setting. 316 | 317 | ## v1.3.1 318 | - Fine tuned completion and auto formatting experience to prevent them from triggering on unexpected situations. 319 | - Fixed clang-format discovering logic on Linux. 320 | 321 | ## v1.3.0 322 | - Auto formatting using clang-format. 323 | - Inlay hints: show inline hints for parameter names and auto deduced types. 324 | - Fixed a bug where setting predefined macros without a value caused language server to crash. 325 | 326 | ## v1.2.2 327 | - Auto completion now provides suggestions for general types, expressions and bracket attributes in addition to members. 328 | - Add configuration to turn on/off commit characters for auto completion. 329 | - Support highlighting macro invocations. 330 | - Support hover info for macro invocations. 331 | - Support goto definition for #include and import. 332 | - Performance improvements. Reduces auto completion/semantic highlighting reponse time by 50%. 333 | 334 | ## v1.2.0 335 | - Supports document symbol outline feature. 336 | - Add MacOS support. 337 | - Fixed highlighting of `extension` decl's target type. 338 | - Add missing highlight for several HLSL keywords. 339 | - Stability fixes. 340 | 341 | ## v1.1.2 342 | - Add configuration for search paths. 343 | - Fix highlighting bug. 344 | - Improved parser recovery around undefined macro invocations. 345 | 346 | ## v1.1.1 347 | - Fixed several scenarios where completion failed to trigger. 348 | - Fixed an issue that caused static variable members to be missing from static member completion suggestions. 349 | 350 | ## v1.1.0 351 | - Improved performance when processing large files. 352 | - Coloring property accessors and constructor calls. 353 | - Exclude instance members in a static member completion query. 354 | - Improved signature help cursor range check. 355 | - Support configuring predefined preprocessor macros in extension settings. 356 | - Add auto completion suggestions for HLSL semantics. 357 | - Improved parser robustness. 358 | 359 | ## v1.0.7 360 | - Further improves parser stability. 361 | - Add coloring for missing hlsl keywords. 362 | 363 | ## v1.0.4 364 | - Add commit characters for auto completion. 365 | - Fixed parser crashes. 366 | 367 | ## v1.0.3 368 | - Fixed file permission issue of the language server on linux. 369 | 370 | ## v1.0.2 371 | - Fixed bugs in files that uses `#include`. 372 | - Reduced diagnostic message update frequency. 373 | 374 | ## v1.0.1 375 | - Package up javascript files for faster performance. 376 | - Add icon. 377 | - Add hlsl file extension. 378 | 379 | ## v0.0.1 380 | - Initial release. Basic syntax highlighting support for Slang and HLSL. 381 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | A reminder that this issue tracker is managed by the Khronos Group. Interactions here should follow the Khronos Code of Conduct ([https://www.khronos.org/developers/code-of-conduct](https://www.khronos.org/developers/code-of-conduct)), which prohibits aggressive or derogatory language. Please keep the discussion friendly and civil. 2 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing 2 | 3 | This project welcomes contributions and suggestions. Contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant the rights to use your contribution. 4 | 5 | When you submit a pull request, a CLA bot will determine whether you need to sign a CLA. Simply follow the instructions provided. -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | LLVM Exceptions to the Apache 2.0 License 16 | 17 | As an exception, if, as a result of your compiling your source code, portions 18 | of this Software are embedded into an Object form of such source code, you 19 | may redistribute such embedded portions in such Object form without complying 20 | with the conditions of Sections 4(a), 4(b) and 4(d) of the License. 21 | 22 | In addition, if you combine or link compiled forms of this Software with 23 | software that is licensed under the GPLv2 ("Combined Software") and if a 24 | court of competent jurisdiction determines that the patent provision (Section 25 | 3), the indemnity provision (Section 9) or other Section of the License 26 | conflicts with the conditions of the GPLv2, you may retroactively and 27 | prospectively choose to deem waived or otherwise exclude such Section(s) of 28 | the License, but only in their entirety and only with respect to the Combined 29 | Software. 30 | -------------------------------------------------------------------------------- /LICENSES/Apache-2.0.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. 10 | 11 | "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. 12 | 13 | "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. 14 | 15 | "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. 16 | 17 | "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. 18 | 19 | "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. 20 | 21 | "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). 22 | 23 | "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. 24 | 25 | "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." 26 | 27 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 28 | 29 | 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 30 | 31 | 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 32 | 33 | 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: 34 | 35 | (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and 36 | 37 | (b) You must cause any modified files to carry prominent notices stating that You changed the files; and 38 | 39 | (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and 40 | 41 | (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. 42 | 43 | You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 44 | 45 | 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 46 | 47 | 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 48 | 49 | 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 50 | 51 | 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 52 | 53 | 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. 54 | 55 | END OF TERMS AND CONDITIONS 56 | 57 | APPENDIX: How to apply the Apache License to your work. 58 | 59 | To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. 60 | 61 | Copyright [yyyy] [name of copyright owner] 62 | 63 | Licensed under the Apache License, Version 2.0 (the "License"); 64 | you may not use this file except in compliance with the License. 65 | You may obtain a copy of the License at 66 | 67 | http://www.apache.org/licenses/LICENSE-2.0 68 | 69 | Unless required by applicable law or agreed to in writing, software 70 | distributed under the License is distributed on an "AS IS" BASIS, 71 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 72 | See the License for the specific language governing permissions and 73 | limitations under the License. 74 | -------------------------------------------------------------------------------- /LICENSES/CC-BY-4.0.txt: -------------------------------------------------------------------------------- 1 | Creative Commons Attribution 4.0 International 2 | 3 | Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible. 4 | 5 | Using Creative Commons Public Licenses 6 | 7 | Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses. 8 | 9 | Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors. 10 | 11 | Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public. 12 | 13 | Creative Commons Attribution 4.0 International Public License 14 | 15 | By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. 16 | 17 | Section 1 – Definitions. 18 | 19 | a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. 20 | 21 | b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. 22 | 23 | c. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. 24 | 25 | d. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. 26 | 27 | e. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. 28 | 29 | f. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. 30 | 31 | g. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. 32 | 33 | h. Licensor means the individual(s) or entity(ies) granting rights under this Public License. 34 | 35 | i. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. 36 | 37 | j. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. 38 | 39 | k. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. 40 | 41 | Section 2 – Scope. 42 | 43 | a. License grant. 44 | 45 | 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: 46 | 47 | A. reproduce and Share the Licensed Material, in whole or in part; and 48 | 49 | B. produce, reproduce, and Share Adapted Material. 50 | 51 | 2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. 52 | 53 | 3. Term. The term of this Public License is specified in Section 6(a). 54 | 55 | 4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. 56 | 57 | 5. Downstream recipients. 58 | 59 | A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. 60 | 61 | B. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. 62 | 63 | 6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). 64 | 65 | b. Other rights. 66 | 67 | 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. 68 | 69 | 2. Patent and trademark rights are not licensed under this Public License. 70 | 71 | 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties. 72 | 73 | Section 3 – License Conditions. 74 | 75 | Your exercise of the Licensed Rights is expressly made subject to the following conditions. 76 | 77 | a. Attribution. 78 | 79 | 1. If You Share the Licensed Material (including in modified form), You must: 80 | 81 | A. retain the following if it is supplied by the Licensor with the Licensed Material: 82 | 83 | i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); 84 | 85 | ii. a copyright notice; 86 | 87 | iii. a notice that refers to this Public License; 88 | 89 | iv. a notice that refers to the disclaimer of warranties; 90 | 91 | v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; 92 | 93 | B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and 94 | 95 | C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. 96 | 97 | 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. 98 | 99 | 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. 100 | 101 | 4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License. 102 | 103 | Section 4 – Sui Generis Database Rights. 104 | 105 | Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: 106 | 107 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database; 108 | 109 | b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and 110 | 111 | c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. 112 | For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. 113 | 114 | Section 5 – Disclaimer of Warranties and Limitation of Liability. 115 | 116 | a. Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You. 117 | 118 | b. To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You. 119 | 120 | c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. 121 | 122 | Section 6 – Term and Termination. 123 | 124 | a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. 125 | 126 | b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: 127 | 128 | 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or 129 | 130 | 2. upon express reinstatement by the Licensor. 131 | 132 | c. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. 133 | 134 | d. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. 135 | 136 | e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. 137 | 138 | Section 7 – Other Terms and Conditions. 139 | 140 | a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. 141 | 142 | b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. 143 | 144 | Section 8 – Interpretation. 145 | 146 | a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. 147 | 148 | b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. 149 | 150 | c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. 151 | 152 | d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. 153 | 154 | Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. 155 | 156 | Creative Commons may be contacted at creativecommons.org. 157 | -------------------------------------------------------------------------------- /LICENSES/LLVM-exception.txt: -------------------------------------------------------------------------------- 1 | ---- LLVM Exceptions to the Apache 2.0 License ---- 2 | 3 | As an exception, if, as a result of your compiling your source code, portions 4 | of this Software are embedded into an Object form of such source code, you 5 | may redistribute such embedded portions in such Object form without complying 6 | with the conditions of Sections 4(a), 4(b) and 4(d) of the License. 7 | 8 | In addition, if you combine or link compiled forms of this Software with 9 | software that is licensed under the GPLv2 ("Combined Software") and if a 10 | court of competent jurisdiction determines that the patent provision (Section 11 | 3), the indemnity provision (Section 9) or other Section of the License 12 | conflicts with the conditions of the GPLv2, you may retroactively and 13 | prospectively choose to deem waived or otherwise exclude such Section(s) of 14 | the License, but only in their entirety and only with respect to the Combined 15 | Software. 16 | -------------------------------------------------------------------------------- /LICENSES/MIT.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The Slang Shading Language VSCode Extension 2 | 3 | This is the official Visual Studio Code extension for the Slang shading language. Powered by the Slang shader compiler, this extension provides accurate coding assist for both Slang and HLSL. 4 | 5 | Both Slang and this extension are open source projects on GitHub. We welcome feedback and contributions. Please report issues or suggest improvements at https://github.com/shader-slang/slang-vscode-extension/issues 6 | 7 | 8 | ## Features 9 | 10 | This extension provides the following assisting features: 11 | - Enhanced semantic highlighting: user-defined types, variables, parameters, properties and macros will be highlighted. 12 | - Code completion: show context-aware suggestions of variables, functions, types, members, keywords, attributes, HLSL semantics, and `include`/`import` paths. 13 | - Function signature help: view function signatures at call sites. 14 | - Hover information: displays the signature and documentation for the symbol that your mouse is hovering over. 15 | - Go to definition: jumps to the source location that defines the current symbol. 16 | - Document symbol: displays the outline of symbols defined in current document. 17 | - Inlay hint: shows inline hints for parameter names and deduced types. 18 | - Code formatting. 19 | - Diagnostics: displays current compilation errors. 20 | 21 | **Note:** the code formatting feature requires `clang-format` to be available on your system. The location of clang-format can be configured in the extension settings. 22 | 23 | ## Configurations 24 | 25 | ### Predefined preprocessor macros 26 | 27 | You can specifiy the set of predefined preprocessor macros that the language server will use via the `slang.predefinedMacros` setting. This will help the language server to provide more accurate result. 28 | 29 | ### Additional Search Path 30 | 31 | By default, the extension will search for all sub directories in the current workspace for an included or imported file. You can specify additional search paths via the `slang.additionalSearchPaths` setting, which will be looked at first. You can also disable the search in workspace directories and make the extension to search only in configured search paths (via `slang.searchInAllWorkspaceDirectories`). The path of the currently opend file will always be used. 32 | 33 | ### Commit characters for auto completion 34 | 35 | Select whether or not to use commit characters to select an auto completion item in addition to pressing the enter key. You can enable commit characters for member completion only or for all types of completion suggestions. 36 | 37 | ### `clang-format` location and style 38 | The Slang language extension supports auto-formatting with `clang-format`. To use this feature, `clang-format` must be available on your system. By default, the extension will look for `clang-format` in `PATH`. If not found, the extension will try to use the `clang-format` bundled with VSCode C++ extension. If neither options are available, the user must provide the path to `clang-format` via the `slang.format.clangFormatLocation` extension setting. 39 | 40 | You can customize the style to use with `clang-format` with the `slang.format.clangFormatStyle` setting. 41 | 42 | You may also configure the `slang.format.clangFormatFallbackStyle` setting to specify the style to use when `slang.format.clangFormatStyle` is set to `file` but a `.clang-format` file is not found. 43 | 44 | ## Demo 45 | 46 | Auto completion and signature help: 47 | ![Auto completion and signature help](doc/auto-complete.gif) 48 | 49 | Goto definition: 50 | ![Goto definition](doc/goto-def.gif) 51 | 52 | ## For more information 53 | 54 | * [Slang public repository](http://github.com/shader-slang/slang) 55 | * [Slang Visual Studio Code Extension repository](https://github.com/shader-slang/slang-vscode-extension) 56 | 57 | -------------------------------------------------------------------------------- /build-package.sh: -------------------------------------------------------------------------------- 1 | npm install 2 | npm install -g @vscode/vsce 3 | 4 | target_build() { 5 | TEMP_DIR="$(mktemp -d)" 6 | ZIP="$1" 7 | TARGET="$2" 8 | TEMP_LIBRARY="$3" 9 | TEMP_EXECUTABLE="$4" 10 | TEMP_LIBRARY_2="$5" 11 | 12 | echo "extracting $ZIP" 13 | unzip -n "$ZIP" -d "$TEMP_DIR" 14 | 15 | echo "installing binaries for $TARGET" 16 | mkdir -p "./server/bin/$TARGET" 17 | cp "$TEMP_DIR/$TEMP_LIBRARY" ./server/bin/"$TARGET"/ 18 | cp "$TEMP_DIR/$TEMP_LIBRARY_2" ./server/bin/"$TARGET"/ 19 | cp "$TEMP_DIR/$TEMP_EXECUTABLE" ./server/bin/"$TARGET"/ 20 | chmod +x ./server/bin/"$TARGET"/* 21 | 22 | echo "building for $TARGET" 23 | vsce package --target "$TARGET" 24 | 25 | echo "cleanup for $TARGET" 26 | rm -rf $TEMP_DIR 27 | rm -rf ./server/bin/ 28 | } 29 | 30 | target_build "$WIN32_X64_ZIP" win32-x64 bin/slang.dll bin/slang-glsl-module.dll bin/slangd.exe 31 | target_build "$WIN32_ARM64_ZIP" win32-arm64 bin/slang.dll bin/slang-glsl-module.dll bin/slangd.exe 32 | target_build "$LINUX_X64_ZIP" linux-x64 lib/libslang.so lib/libslang-glsl-module.so bin/slangd 33 | target_build "$LINUX_ARM64_ZIP" linux-arm64 lib/libslang.so lib/libslang-glsl-module.so bin/slangd 34 | target_build "$DARWIN_X64_ZIP" darwin-x64 lib/libslang.dylib lib/libslang-glsl-module.dylib bin/slangd 35 | target_build "$DARWIN_ARM64_ZIP" darwin-arm64 lib/libslang.dylib lib/libslang-glsl-module.dylib bin/slangd 36 | -------------------------------------------------------------------------------- /client/src/extension.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import * as path from 'path'; 7 | import { workspace, ExtensionContext } from 'vscode'; 8 | 9 | import { 10 | LanguageClient, 11 | LanguageClientOptions, 12 | ServerOptions, 13 | TransportKind 14 | } from 'vscode-languageclient/node'; 15 | 16 | let client: LanguageClient; 17 | 18 | export function activate(context: ExtensionContext) { 19 | let slangdLoc = workspace.getConfiguration("slang").get("slangdLocation", ""); 20 | if (slangdLoc === "") slangdLoc = context.asAbsolutePath( 21 | path.join('server', 'bin', process.platform + '-' + process.arch, 'slangd') 22 | ) 23 | const serverModule = slangdLoc; 24 | const serverOptions: ServerOptions = { 25 | run : { command: serverModule, transport: TransportKind.stdio}, 26 | debug: {command: serverModule, transport: TransportKind.stdio 27 | // , args: ["--debug"] 28 | } 29 | }; 30 | // Options to control the language client 31 | const clientOptions: LanguageClientOptions = { 32 | // Register the server for plain text documents 33 | documentSelector: [{ scheme: 'file', language: 'slang' }], 34 | }; 35 | 36 | // Create the language client and start the client. 37 | client = new LanguageClient( 38 | 'slangLanguageServer', 39 | 'Slang Language Server', 40 | serverOptions, 41 | clientOptions 42 | ); 43 | // Start the client. This will also launch the server 44 | client.start(); 45 | } 46 | 47 | export function deactivate(): Thenable | undefined { 48 | if (!client) { 49 | return undefined; 50 | } 51 | return client.stop(); 52 | } 53 | -------------------------------------------------------------------------------- /doc/auto-complete.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shader-slang/slang-vscode-extension/63a7ca9118b697a5c3a8ff7a60f7823d8f2eea01/doc/auto-complete.gif -------------------------------------------------------------------------------- /doc/goto-def.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shader-slang/slang-vscode-extension/63a7ca9118b697a5c3a8ff7a60f7823d8f2eea01/doc/goto-def.gif -------------------------------------------------------------------------------- /images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shader-slang/slang-vscode-extension/63a7ca9118b697a5c3a8ff7a60f7823d8f2eea01/images/icon.png -------------------------------------------------------------------------------- /language-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments": { 3 | "lineComment": "//", 4 | "blockComment": [ "/*", "*/" ] 5 | }, 6 | // symbols used as brackets 7 | "brackets": [ 8 | ["{", "}"], 9 | ["[", "]"], 10 | ["(", ")"] 11 | ], 12 | // symbols that are auto closed when typing 13 | "autoClosingPairs": [ 14 | ["{", "}"], 15 | ["[", "]"], 16 | ["(", ")"], 17 | ["\"", "\""], 18 | ["'", "'"] 19 | ], 20 | // symbols that can be used to surround a selection 21 | "surroundingPairs": [ 22 | ["{", "}"], 23 | ["[", "]"], 24 | ["(", ")"], 25 | ["\"", "\""], 26 | ["'", "'"] 27 | ], 28 | "indentationRules": { 29 | "indentNextLinePattern": "^\\s*(if|for|while)\\s*\\(.*\\)\\s*$", 30 | "increaseIndentPattern": "^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*|case\\s*.*\\s*:)$", 31 | "decreaseIndentPattern": "^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$" 32 | } 33 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "slang-language-extension", 3 | "displayName": "Slang", 4 | "description": "Extension for the Slang Shading Language", 5 | "publisher": "shader-slang", 6 | "version": "1.9.10", 7 | "icon": "./images/icon.png", 8 | "engines": { 9 | "vscode": "^1.67.0" 10 | }, 11 | "keywords": [ 12 | "shader", 13 | "shading", 14 | "hlsl", 15 | "slang", 16 | "highlight", 17 | "completion", 18 | "hinting", 19 | "formatting" 20 | ], 21 | "categories": [ 22 | "Programming Languages", 23 | "Formatters" 24 | ], 25 | "activationEvents": [ 26 | "onLanguage:slang" 27 | ], 28 | "repository": { 29 | "type": "git", 30 | "url": "https://github.com/shader-slang/slang-vscode-extension" 31 | }, 32 | "main": "./client/out/main", 33 | "contributes": { 34 | "languages": [ 35 | { 36 | "id": "slang", 37 | "aliases": [ 38 | "Slang", 39 | "slang", 40 | "hlsl" 41 | ], 42 | "extensions": [ 43 | ".slang", 44 | ".slangh", 45 | ".hlsl", 46 | ".usf", 47 | ".ush", 48 | ".vfx", 49 | ".fxc" 50 | ], 51 | "configuration": "./language-configuration.json" 52 | } 53 | ], 54 | "configurationDefaults": { 55 | "[slang]": { 56 | "editor.wordBasedSuggestions": "off", 57 | "editor.formatOnType": true, 58 | "editor.formatOnPaste": true, 59 | "editor.inlayHints.enabled": "offUnlessPressed" 60 | } 61 | }, 62 | "grammars": [ 63 | { 64 | "language": "slang", 65 | "scopeName": "source.slang", 66 | "path": "./syntaxes/slang.tmLanguage.json" 67 | } 68 | ], 69 | "configuration": { 70 | "type": "object", 71 | "title": "Slang/HLSL", 72 | "properties": { 73 | "slang.predefinedMacros": { 74 | "scope": "window", 75 | "type": "array", 76 | "items": {"type": "string"}, 77 | "examples": [["MY_MACRO", "MY_VALUE_MACRO=1"]], 78 | "default": [], 79 | "markdownDescription": "Predefined macros to use in the language server. Each item contains one macro definition. You can also use `macro_name=value` syntax to specify the value of the macro." 80 | }, 81 | "slang.searchInAllWorkspaceDirectories": { 82 | "scope": "window", 83 | "type": "boolean", 84 | "default": true, 85 | "description": "Controls whether or not the language server should look in all sub-directories in the current workspace for an include or imported file if it is not found in the explicitly specified search paths." 86 | }, 87 | "slang.additionalSearchPaths": { 88 | "scope": "window", 89 | "type": "array", 90 | "items": {"type": "string"}, 91 | "examples": [["include/", "c:\\external-lib\\include"]], 92 | "default": [], 93 | "description": "The language server will search for the included or imported file in these additional directories first. If not found, the server will look in all sub directories in the current workspace (if enabled by the setting)." 94 | }, 95 | "slang.enableCommitCharactersInAutoCompletion": { 96 | "scope": "window", 97 | "type": "string", 98 | "enum": [ 99 | "off", 100 | "membersOnly", 101 | "on" 102 | ], 103 | "default": "membersOnly", 104 | "markdownDescription": "Controls whether or not to enable commit characters for selecting an auto completion item in addition to pressing enter. 'off' - disabled. 'memberOnly' - use commit characters in a member list only. 'on' - use commit characters for all types of completions." 105 | }, 106 | "slang.format.clangFormatLocation": { 107 | "scope": "machine-overridable", 108 | "type": "string", 109 | "default": "", 110 | "markdownDescription": "The location of clang-format for auto formatting, including the executable name. If left unspecified, will attempt to find `clang-format` under `PATH`, or under C++ extension installation path." 111 | }, 112 | "slang.slangdLocation": { 113 | "scope": "machine-overridable", 114 | "type": "string", 115 | "default": "", 116 | "markdownDescription": "The location of Slang's language server executable `slangd`. Will use bundled language server when unspecified." 117 | }, 118 | "slang.format.clangFormatStyle": { 119 | "scope": "window", 120 | "type": "string", 121 | "default": "file", 122 | "markdownDescription": "The `-style` argument to pass to clang-format, without quotes. Examples: `Microsoft`, `LLVM`, `file:fileName`. Default value is `file`" 123 | }, 124 | "slang.format.clangFormatFallbackStyle": { 125 | "scope": "window", 126 | "type": "string", 127 | "default": "{BasedOnStyle: Microsoft, BreakBeforeBraces: Allman, ColumnLimit: 0}", 128 | "markdownDescription": "The `-fallback-style` argument to pass to clang-format, without quotes. Examples: `Microsoft`, `LLVM`, `file:fileName`. Default value is `{BasedOnStyle: Microsoft, BreakBeforeBraces: Allman, ColumnLimit: 0}`" 129 | }, 130 | "slang.format.allowLineBreakChangesInOnTypeFormatting": 131 | { 132 | "scope": "window", 133 | "type": "boolean", 134 | "default": false, 135 | "markdownDescription": "Controls whether the extension is allowed to make line-break changes when reformatting the code on typing." 136 | }, 137 | "slang.format.allowLineBreakChangesInRangeFormatting": { 138 | "scope": "window", 139 | "type": "boolean", 140 | "default": false, 141 | "markdownDescription": "Controls whether the extension is allowed to make line-break changes when doing range formatting, such as formatting on paste or on command." 142 | }, 143 | "slang.inlayHints.deducedTypes": { 144 | "scope": "window", 145 | "type": "boolean", 146 | "default": true, 147 | "markdownDescription": "Enable inlay hints for duduced decl types, e.g. the deduced type in `var i = 2`" 148 | }, 149 | "slang.inlayHints.parameterNames": { 150 | "scope": "window", 151 | "type": "boolean", 152 | "default": true, 153 | "description": "Enable inlay hints for parameter names at call sites." 154 | }, 155 | "slangLanguageServer.trace.server": { 156 | "scope": "window", 157 | "type": "string", 158 | "enum": [ 159 | "off", 160 | "messages", 161 | "verbose" 162 | ], 163 | "default": "off", 164 | "description": "Traces the communication between VS Code and the language server." 165 | } 166 | } 167 | } 168 | }, 169 | "devDependencies": { 170 | "@types/vscode": "^1.67.0", 171 | "@vscode/test-electron": "^2.1.2", 172 | "@types/mocha": "^9.1.0", 173 | "@types/node": "^16.11.7", 174 | "@typescript-eslint/eslint-plugin": "^5.19.0", 175 | "@typescript-eslint/parser": "^5.19.0", 176 | "esbuild": "^0.14.42", 177 | "eslint": "^8.13.0", 178 | "mocha": "^9.2.1", 179 | "typescript": "^4.7.2" 180 | }, 181 | "dependencies": { 182 | "vscode-languageclient": "^8.0.1" 183 | }, 184 | "scripts": { 185 | "vscode:prepublish": "npm run esbuild-base -- --minify", 186 | "esbuild-base": "esbuild ./client/src/extension.ts --bundle --outfile=client/out/main.js --external:vscode --format=cjs --platform=node", 187 | "esbuild": "npm run esbuild-base -- --sourcemap", 188 | "esbuild-watch": "npm run esbuild-base -- --sourcemap --watch", 189 | "test-compile": "tsc -p ./" 190 | } 191 | } 192 | -------------------------------------------------------------------------------- /syntaxes/slang.tmLanguage.json: -------------------------------------------------------------------------------- 1 | { 2 | "scopeName": "source.slang", 3 | "patterns": [ 4 | { 5 | "include": "#preprocessor-rule-enabled" 6 | }, 7 | { 8 | "include": "#preprocessor-rule-disabled" 9 | }, 10 | { 11 | "include": "#preprocessor-rule-conditional" 12 | }, 13 | { 14 | "include": "#predefined_macros" 15 | }, 16 | { 17 | "include": "#comments" 18 | }, 19 | { 20 | "include": "#switch_statement" 21 | }, 22 | { 23 | "match": "\\b(break|continue|do|else|for|goto|if|return|while|try|throw|catch|defer|discard)\\b", 24 | "name": "keyword.control.slang" 25 | }, 26 | { 27 | "include": "#storage_types" 28 | }, 29 | { 30 | "match": "typedef", 31 | "name": "keyword.other.typedef.slang" 32 | }, 33 | { 34 | "name": "keyword.other.additional.slang", 35 | "match": "\\b(throws|using|__generic|func|associatedtype|public|internal|private|import|module|implementing|__include|export|__exported|groupshared|let|var|property|extension|in|out|inout|ref|namespace|this|cbuffer|tbuffer|(dynamic_)?uniform|typealias|new|__extern_cpp|__(target|stage)_intrinsic|__intrinsic_asm|spirv_asm|(__)?(f|b)wd_diff|__dispatch_kernel|no_diff|__constref|expand|each|where|typename|constexpr|dyn|some|implicit|noncopyable)\\b" 36 | }, 37 | { 38 | "match": "\\b(const|extern|register|restrict|static|volatile|inline|nointerpolation|precise|row_major|column_major|snorm|unorm|globallycoherent|layout)\\b", 39 | "name": "storage.modifier.slang" 40 | }, 41 | { 42 | "match": "\\bk[A-Z]\\w*\\b", 43 | "name": "constant.other.variable.mac-classic.slang" 44 | }, 45 | { 46 | "match": "\\bg[A-Z]\\w*\\b", 47 | "name": "variable.other.readwrite.global.mac-classic.slang" 48 | }, 49 | { 50 | "match": "\\bs[A-Z]\\w*\\b", 51 | "name": "variable.other.readwrite.static.mac-classic.slang" 52 | }, 53 | { 54 | "match": "\\b(nullptr|none|true|false)\\b", 55 | "name": "constant.language.slang" 56 | }, 57 | { 58 | "include": "#operators" 59 | }, 60 | { 61 | "include": "#numbers" 62 | }, 63 | { 64 | "include": "#strings" 65 | }, 66 | { 67 | "name": "meta.preprocessor.macro.slang", 68 | "begin": "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((#)\\s*define\\b)\\s+((?", 245 | "endCaptures": { 246 | "0": { 247 | "name": "punctuation.definition.string.end.slang" 248 | } 249 | }, 250 | "name": "string.quoted.other.lt-gt.include.slang" 251 | } 252 | ] 253 | }, 254 | { 255 | "include": "#pragma-mark" 256 | }, 257 | { 258 | "include": "#preprocessor-version" 259 | }, 260 | { 261 | "begin": "^\\s*((#)\\s*line)\\b", 262 | "beginCaptures": { 263 | "1": { 264 | "name": "keyword.control.directive.line.slang" 265 | }, 266 | "2": { 267 | "name": "punctuation.definition.directive.slang" 268 | } 269 | }, 270 | "end": "(?=(?://|/\\*))|(?))((?:(?:[a-zA-Z_][a-zA-Z_0-9]*)\\s*(?:(?:\\.)|(?:->)))*)\\s*([a-zA-Z_][a-zA-Z_0-9]*)(\\()", 403 | "beginCaptures": { 404 | "1": { 405 | "name": "variable.object.slang" 406 | }, 407 | "2": { 408 | "name": "punctuation.separator.dot-access.slang" 409 | }, 410 | "3": { 411 | "name": "punctuation.separator.pointer-access.slang" 412 | }, 413 | "4": { 414 | "patterns": [ 415 | { 416 | "match": "\\.", 417 | "name": "punctuation.separator.dot-access.slang" 418 | }, 419 | { 420 | "match": "->", 421 | "name": "punctuation.separator.pointer-access.slang" 422 | }, 423 | { 424 | "match": "[a-zA-Z_][a-zA-Z_0-9]*", 425 | "name": "variable.object.slang" 426 | }, 427 | { 428 | "name": "everything.else.slang", 429 | "match": ".+" 430 | } 431 | ] 432 | }, 433 | "5": { 434 | "name": "entity.name.function.member.slang" 435 | }, 436 | "6": { 437 | "name": "punctuation.section.arguments.begin.bracket.round.function.member.slang" 438 | } 439 | }, 440 | "end": "\\)", 441 | "endCaptures": { 442 | "0": { 443 | "name": "punctuation.section.arguments.end.bracket.round.function.member.slang" 444 | } 445 | }, 446 | "patterns": [ 447 | { 448 | "include": "#function-call-innards" 449 | } 450 | ] 451 | }, 452 | "backslash_escapes": { 453 | "match": "(?x)\\\\ (\n\\\\\t\t\t |\n[abefnprtv'\"?] |\n[0-3][0-7]{,2}\t |\n[4-7]\\d?\t\t|\nx[a-fA-F0-9]{,2} |\nu[a-fA-F0-9]{,4} |\nU[a-fA-F0-9]{,8} )", 454 | "name": "constant.character.escape.slang" 455 | }, 456 | "block": { 457 | "patterns": [ 458 | { 459 | "begin": "{", 460 | "beginCaptures": { 461 | "0": { 462 | "name": "punctuation.section.block.begin.bracket.curly.slang" 463 | } 464 | }, 465 | "end": "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)", 466 | "endCaptures": { 467 | "0": { 468 | "name": "punctuation.section.block.end.bracket.curly.slang" 469 | } 470 | }, 471 | "name": "meta.block.slang", 472 | "patterns": [ 473 | { 474 | "include": "#block_innards" 475 | } 476 | ] 477 | } 478 | ] 479 | }, 480 | "block_innards": { 481 | "patterns": [ 482 | { 483 | "include": "#preprocessor-rule-enabled-block" 484 | }, 485 | { 486 | "include": "#preprocessor-rule-disabled-block" 487 | }, 488 | { 489 | "include": "#preprocessor-rule-conditional-block" 490 | }, 491 | { 492 | "include": "#method_access" 493 | }, 494 | { 495 | "include": "#member_access" 496 | }, 497 | { 498 | "include": "#c_function_call" 499 | }, 500 | { 501 | "name": "meta.initialization.slang", 502 | "begin": "(?x)\n(?:\n (?:\n\t(?=\\s)(?=+!]+ | \\(\\) | \\[\\]))\n)\n\\s*(\\() # opening bracket", 503 | "beginCaptures": { 504 | "1": { 505 | "name": "variable.other.slang" 506 | }, 507 | "2": { 508 | "name": "punctuation.section.parens.begin.bracket.round.initialization.slang" 509 | } 510 | }, 511 | "end": "\\)", 512 | "endCaptures": { 513 | "0": { 514 | "name": "punctuation.section.parens.end.bracket.round.initialization.slang" 515 | } 516 | }, 517 | "patterns": [ 518 | { 519 | "include": "#function-call-innards" 520 | } 521 | ] 522 | }, 523 | { 524 | "begin": "{", 525 | "beginCaptures": { 526 | "0": { 527 | "name": "punctuation.section.block.begin.bracket.curly.slang" 528 | } 529 | }, 530 | "end": "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)", 531 | "endCaptures": { 532 | "0": { 533 | "name": "punctuation.section.block.end.bracket.curly.slang" 534 | } 535 | }, 536 | "patterns": [ 537 | { 538 | "include": "#block_innards" 539 | } 540 | ] 541 | }, 542 | { 543 | "include": "#parens-block" 544 | }, 545 | { 546 | "include": "$base" 547 | } 548 | ] 549 | }, 550 | "c_conditional_context": { 551 | "patterns": [ 552 | { 553 | "include": "$self" 554 | }, 555 | { 556 | "include": "#block_innards" 557 | } 558 | ] 559 | }, 560 | "c_function_call": { 561 | "begin": "(?x)\n(?!(?:while|for|do|if|else|switch|catch|enumerate|return|typeid|alignof|alignas|sizeof|countof|where|(__)?(f|b)wd_diff|__dispatch_kernel|no_diff|__constref|__target_intrinsic|__intrinsic_asm|spirv_asm|expand|each)\\s*\\()\n(?=\n(?:[A-Za-z_][A-Za-z0-9_]*+|::)++\\s*\\( # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)", 562 | "end": "(?<=\\))(?!\\w)", 563 | "name": "meta.function-call.slang", 564 | "patterns": [ 565 | { 566 | "include": "#function-call-innards" 567 | } 568 | ] 569 | }, 570 | "case_statement": { 571 | "name": "meta.conditional.case.slang", 572 | "begin": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?\\s*)(\\/\\/[!\\/]+)", 623 | "beginCaptures": { 624 | "1": { 625 | "name": "punctuation.definition.comment.documentation.slang" 626 | } 627 | }, 628 | "end": "(?<=\\n)(?|%|\"|\\.|=|::|\\||\\-\\-|\\-\\-\\-)\\b(?:\\{[^}]*\\})?", 635 | "name": "storage.type.class.doxygen.slang" 636 | }, 637 | { 638 | "match": "((?<=[\\s*!\\/])[\\\\@](?:a|em|e))\\s+(\\S+)", 639 | "captures": { 640 | "1": { 641 | "name": "storage.type.class.doxygen.slang" 642 | }, 643 | "2": { 644 | "name": "markup.italic.doxygen.slang" 645 | } 646 | } 647 | }, 648 | { 649 | "match": "((?<=[\\s*!\\/])[\\\\@]b)\\s+(\\S+)", 650 | "captures": { 651 | "1": { 652 | "name": "storage.type.class.doxygen.slang" 653 | }, 654 | "2": { 655 | "name": "markup.bold.doxygen.slang" 656 | } 657 | } 658 | }, 659 | { 660 | "match": "((?<=[\\s*!\\/])[\\\\@](?:c|p))\\s+(\\S+)", 661 | "captures": { 662 | "1": { 663 | "name": "storage.type.class.doxygen.slang" 664 | }, 665 | "2": { 666 | "name": "markup.inline.raw.string.slang" 667 | } 668 | } 669 | }, 670 | { 671 | "match": "(?<=[\\s*!\\/])[\\\\@](?:a|anchor|b|c|cite|copybrief|copydetail|copydoc|def|dir|dontinclude|e|em|emoji|enum|example|extends|file|idlexcept|implements|include|includedoc|includelineno|latexinclude|link|memberof|namespace|p|package|ref|refitem|related|relates|relatedalso|relatesalso|verbinclude)\\b(?:\\{[^}]*\\})?", 672 | "name": "storage.type.class.doxygen.slang" 673 | }, 674 | { 675 | "match": "(?<=[\\s*!\\/])[\\\\@](?:addindex|addtogroup|category|class|defgroup|diafile|dotfile|elseif|fn|headerfile|if|ifnot|image|ingroup|interface|line|mainpage|mscfile|name|overload|page|property|protocol|section|skip|skipline|snippet|snippetdoc|snippetlineno|struct|subpage|subsection|subsubsection|typedef|union|until|vhdlflow|weakgroup)\\b(?:\\{[^}]*\\})?", 676 | "name": "storage.type.class.doxygen.slang" 677 | }, 678 | { 679 | "match": "((?<=[\\s*!\\/])[\\\\@]param)(?:\\s*\\[((?:,?\\s*(?:in|out)\\s*)+)\\])?\\s+(\\b\\w+\\b)", 680 | "captures": { 681 | "1": { 682 | "name": "storage.type.class.doxygen.slang" 683 | }, 684 | "2": { 685 | "patterns": [ 686 | { 687 | "match": "in|out|ref", 688 | "name": "keyword.other.parameter.direction.$0.slang" 689 | } 690 | ] 691 | }, 692 | "3": { 693 | "name": "variable.parameter.slang" 694 | } 695 | } 696 | }, 697 | { 698 | "match": "(?<=[\\s*!\\/])[\\\\@](?:arg|attention|author|authors|brief|bug|copyright|date|deprecated|details|exception|invariant|li|note|par|paragraph|param|post|pre|remark|remarks|result|return|returns|retval|sa|see|short|since|test|throw|todo|tparam|version|warning|xrefitem)\\b(?:\\{[^}]*\\})?", 699 | "name": "storage.type.class.doxygen.slang" 700 | }, 701 | { 702 | "match": "(?<=[\\s*!\\/])[\\\\@](?:code|cond|docbookonly|dot|htmlonly|internal|latexonly|link|manonly|msc|parblock|rtfonly|secreflist|uml|verbatim|xmlonly|endcode|endcond|enddocbookonly|enddot|endhtmlonly|endinternal|endlatexonly|endlink|endmanonly|endmsc|endparblock|endrtfonly|endsecreflist|enduml|endverbatim|endxmlonly)\\b(?:\\{[^}]*\\})?", 703 | "name": "storage.type.class.doxygen.slang" 704 | }, 705 | { 706 | "match": "(?:\\b[A-Z]+:|@[a-z_]+:)", 707 | "name": "storage.type.class.gtkdoc" 708 | } 709 | ] 710 | }, 711 | { 712 | "match": "(\\/\\*[!*]+(?=\\s))(.+)([!*]*\\*\\/)", 713 | "captures": { 714 | "1": { 715 | "name": "punctuation.definition.comment.begin.documentation.slang" 716 | }, 717 | "2": { 718 | "patterns": [ 719 | { 720 | "match": "(?<=[\\s*!\\/])[\\\\@](?:callergraph|callgraph|else|endif|f\\$|f\\[|f\\]|hidecallergraph|hidecallgraph|hiderefby|hiderefs|hideinitializer|htmlinclude|n|nosubgrouping|private|privatesection|protected|protectedsection|public|publicsection|pure|showinitializer|showrefby|showrefs|tableofcontents|\\$|\\#|<|>|%|\"|\\.|=|::|\\||\\-\\-|\\-\\-\\-)\\b(?:\\{[^}]*\\})?", 721 | "name": "storage.type.class.doxygen.slang" 722 | }, 723 | { 724 | "match": "((?<=[\\s*!\\/])[\\\\@](?:a|em|e))\\s+(\\S+)", 725 | "captures": { 726 | "1": { 727 | "name": "storage.type.class.doxygen.slang" 728 | }, 729 | "2": { 730 | "name": "markup.italic.doxygen.slang" 731 | } 732 | } 733 | }, 734 | { 735 | "match": "((?<=[\\s*!\\/])[\\\\@]b)\\s+(\\S+)", 736 | "captures": { 737 | "1": { 738 | "name": "storage.type.class.doxygen.slang" 739 | }, 740 | "2": { 741 | "name": "markup.bold.doxygen.slang" 742 | } 743 | } 744 | }, 745 | { 746 | "match": "((?<=[\\s*!\\/])[\\\\@](?:c|p))\\s+(\\S+)", 747 | "captures": { 748 | "1": { 749 | "name": "storage.type.class.doxygen.slang" 750 | }, 751 | "2": { 752 | "name": "markup.inline.raw.string.slang" 753 | } 754 | } 755 | }, 756 | { 757 | "match": "(?<=[\\s*!\\/])[\\\\@](?:a|anchor|b|c|cite|copybrief|copydetail|copydoc|def|dir|dontinclude|e|em|emoji|enum|example|extends|file|idlexcept|implements|include|includedoc|includelineno|latexinclude|link|memberof|namespace|p|package|ref|refitem|related|relates|relatedalso|relatesalso|verbinclude)\\b(?:\\{[^}]*\\})?", 758 | "name": "storage.type.class.doxygen.slang" 759 | }, 760 | { 761 | "match": "(?<=[\\s*!\\/])[\\\\@](?:addindex|addtogroup|category|class|defgroup|diafile|dotfile|elseif|fn|headerfile|if|ifnot|image|ingroup|interface|line|mainpage|mscfile|name|overload|page|property|protocol|section|skip|skipline|snippet|snippetdoc|snippetlineno|struct|subpage|subsection|subsubsection|typedef|union|until|vhdlflow|weakgroup)\\b(?:\\{[^}]*\\})?", 762 | "name": "storage.type.class.doxygen.slang" 763 | }, 764 | { 765 | "match": "((?<=[\\s*!\\/])[\\\\@]param)(?:\\s*\\[((?:,?\\s*(?:in|out)\\s*)+)\\])?\\s+(\\b\\w+\\b)", 766 | "captures": { 767 | "1": { 768 | "name": "storage.type.class.doxygen.slang" 769 | }, 770 | "2": { 771 | "patterns": [ 772 | { 773 | "match": "in|out", 774 | "name": "keyword.other.parameter.direction.$0.slang" 775 | } 776 | ] 777 | }, 778 | "3": { 779 | "name": "variable.parameter.slang" 780 | } 781 | } 782 | }, 783 | { 784 | "match": "(?<=[\\s*!\\/])[\\\\@](?:arg|attention|author|authors|brief|bug|copyright|date|deprecated|details|exception|invariant|li|note|par|paragraph|param|post|pre|remark|remarks|result|return|returns|retval|sa|see|short|since|test|throw|todo|tparam|version|warning|xrefitem)\\b(?:\\{[^}]*\\})?", 785 | "name": "storage.type.class.doxygen.slang" 786 | }, 787 | { 788 | "match": "(?<=[\\s*!\\/])[\\\\@](?:code|cond|docbookonly|dot|htmlonly|internal|latexonly|link|manonly|msc|parblock|rtfonly|secreflist|uml|verbatim|xmlonly|endcode|endcond|enddocbookonly|enddot|endhtmlonly|endinternal|endlatexonly|endlink|endmanonly|endmsc|endparblock|endrtfonly|endsecreflist|enduml|endverbatim|endxmlonly)\\b(?:\\{[^}]*\\})?", 789 | "name": "storage.type.class.doxygen.slang" 790 | }, 791 | { 792 | "match": "(?:\\b[A-Z]+:|@[a-z_]+:)", 793 | "name": "storage.type.class.gtkdoc" 794 | } 795 | ] 796 | }, 797 | "3": { 798 | "name": "punctuation.definition.comment.end.documentation.slang" 799 | } 800 | }, 801 | "name": "comment.block.documentation.slang" 802 | }, 803 | { 804 | "name": "comment.block.documentation.slang", 805 | "begin": "((?>\\s*)\\/\\*[!*]+(?:(?:\\n|$)|(?=\\s)))", 806 | "beginCaptures": { 807 | "1": { 808 | "name": "punctuation.definition.comment.begin.documentation.slang" 809 | } 810 | }, 811 | "end": "([!*]*\\*\\/)", 812 | "endCaptures": { 813 | "1": { 814 | "name": "punctuation.definition.comment.end.documentation.slang" 815 | } 816 | }, 817 | "patterns": [ 818 | { 819 | "match": "(?<=[\\s*!\\/])[\\\\@](?:callergraph|callgraph|else|endif|f\\$|f\\[|f\\]|hidecallergraph|hidecallgraph|hiderefby|hiderefs|hideinitializer|htmlinclude|n|nosubgrouping|private|privatesection|protected|protectedsection|public|publicsection|pure|showinitializer|showrefby|showrefs|tableofcontents|\\$|\\#|<|>|%|\"|\\.|=|::|\\||\\-\\-|\\-\\-\\-)\\b(?:\\{[^}]*\\})?", 820 | "name": "storage.type.class.doxygen.slang" 821 | }, 822 | { 823 | "match": "((?<=[\\s*!\\/])[\\\\@](?:a|em|e))\\s+(\\S+)", 824 | "captures": { 825 | "1": { 826 | "name": "storage.type.class.doxygen.slang" 827 | }, 828 | "2": { 829 | "name": "markup.italic.doxygen.slang" 830 | } 831 | } 832 | }, 833 | { 834 | "match": "((?<=[\\s*!\\/])[\\\\@]b)\\s+(\\S+)", 835 | "captures": { 836 | "1": { 837 | "name": "storage.type.class.doxygen.slang" 838 | }, 839 | "2": { 840 | "name": "markup.bold.doxygen.slang" 841 | } 842 | } 843 | }, 844 | { 845 | "match": "((?<=[\\s*!\\/])[\\\\@](?:c|p))\\s+(\\S+)", 846 | "captures": { 847 | "1": { 848 | "name": "storage.type.class.doxygen.slang" 849 | }, 850 | "2": { 851 | "name": "markup.inline.raw.string.slang" 852 | } 853 | } 854 | }, 855 | { 856 | "match": "(?<=[\\s*!\\/])[\\\\@](?:a|anchor|b|c|cite|copybrief|copydetail|copydoc|def|dir|dontinclude|e|em|emoji|enum|example|extends|file|idlexcept|implements|include|includedoc|includelineno|latexinclude|link|memberof|namespace|p|package|ref|refitem|related|relates|relatedalso|relatesalso|verbinclude)\\b(?:\\{[^}]*\\})?", 857 | "name": "storage.type.class.doxygen.slang" 858 | }, 859 | { 860 | "match": "(?<=[\\s*!\\/])[\\\\@](?:addindex|addtogroup|category|class|defgroup|diafile|dotfile|elseif|fn|headerfile|if|ifnot|image|ingroup|interface|line|mainpage|mscfile|name|overload|page|property|protocol|section|skip|skipline|snippet|snippetdoc|snippetlineno|struct|subpage|subsection|subsubsection|typedef|union|until|vhdlflow|weakgroup)\\b(?:\\{[^}]*\\})?", 861 | "name": "storage.type.class.doxygen.slang" 862 | }, 863 | { 864 | "match": "((?<=[\\s*!\\/])[\\\\@]param)(?:\\s*\\[((?:,?\\s*(?:in|out)\\s*)+)\\])?\\s+(\\b\\w+\\b)", 865 | "captures": { 866 | "1": { 867 | "name": "storage.type.class.doxygen.slang" 868 | }, 869 | "2": { 870 | "patterns": [ 871 | { 872 | "match": "in|out", 873 | "name": "keyword.other.parameter.direction.$0.slang" 874 | } 875 | ] 876 | }, 877 | "3": { 878 | "name": "variable.parameter.slang" 879 | } 880 | } 881 | }, 882 | { 883 | "match": "(?<=[\\s*!\\/])[\\\\@](?:arg|attention|author|authors|brief|bug|copyright|date|deprecated|details|exception|invariant|li|note|par|paragraph|param|post|pre|remark|remarks|result|return|returns|retval|sa|see|short|since|test|throw|todo|tparam|version|warning|xrefitem)\\b(?:\\{[^}]*\\})?", 884 | "name": "storage.type.class.doxygen.slang" 885 | }, 886 | { 887 | "match": "(?<=[\\s*!\\/])[\\\\@](?:code|cond|docbookonly|dot|htmlonly|internal|latexonly|link|manonly|msc|parblock|rtfonly|secreflist|uml|verbatim|xmlonly|endcode|endcond|enddocbookonly|enddot|endhtmlonly|endinternal|endlatexonly|endlink|endmanonly|endmsc|endparblock|endrtfonly|endsecreflist|enduml|endverbatim|endxmlonly)\\b(?:\\{[^}]*\\})?", 888 | "name": "storage.type.class.doxygen.slang" 889 | }, 890 | { 891 | "match": "(?:\\b[A-Z]+:|@[a-z_]+:)", 892 | "name": "storage.type.class.gtkdoc" 893 | } 894 | ] 895 | }, 896 | { 897 | "match": "^\\/\\* =(\\s*.*?)\\s*= \\*\\/$\\n?", 898 | "captures": { 899 | "1": { 900 | "name": "meta.toc-list.banner.block.slang" 901 | } 902 | }, 903 | "name": "comment.block.banner.slang" 904 | }, 905 | { 906 | "name": "comment.block.slang", 907 | "begin": "(\\/\\*)", 908 | "beginCaptures": { 909 | "1": { 910 | "name": "punctuation.definition.comment.begin.slang" 911 | } 912 | }, 913 | "end": "(\\*\\/)", 914 | "endCaptures": { 915 | "1": { 916 | "name": "punctuation.definition.comment.end.slang" 917 | } 918 | } 919 | }, 920 | { 921 | "match": "^\\/\\/ =(\\s*.*?)\\s*=$\\n?", 922 | "captures": { 923 | "1": { 924 | "name": "meta.toc-list.banner.line.slang" 925 | } 926 | }, 927 | "name": "comment.line.banner.slang" 928 | }, 929 | { 930 | "begin": "((?:^[ \\t]+)?)(?=\\/\\/)", 931 | "beginCaptures": { 932 | "1": { 933 | "name": "punctuation.whitespace.comment.leading.slang" 934 | } 935 | }, 936 | "end": "(?!\\G)", 937 | "patterns": [ 938 | { 939 | "name": "comment.line.double-slash.slang", 940 | "begin": "(\\/\\/)", 941 | "beginCaptures": { 942 | "1": { 943 | "name": "punctuation.definition.comment.slang" 944 | } 945 | }, 946 | "end": "(?=\\n)", 947 | "patterns": [ 948 | { 949 | "include": "#line_continuation_character" 950 | } 951 | ] 952 | } 953 | ] 954 | } 955 | ] 956 | }, 957 | "default_statement": { 958 | "name": "meta.conditional.case.slang", 959 | "begin": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()", 1046 | "beginCaptures": { 1047 | "1": { 1048 | "name": "entity.name.function.slang" 1049 | }, 1050 | "2": { 1051 | "name": "punctuation.section.arguments.begin.bracket.round.slang" 1052 | } 1053 | }, 1054 | "end": "\\)", 1055 | "endCaptures": { 1056 | "0": { 1057 | "name": "punctuation.section.arguments.end.bracket.round.slang" 1058 | } 1059 | }, 1060 | "patterns": [ 1061 | { 1062 | "include": "#function-call-innards" 1063 | } 1064 | ] 1065 | }, 1066 | { 1067 | "begin": "\\(", 1068 | "beginCaptures": { 1069 | "0": { 1070 | "name": "punctuation.section.parens.begin.bracket.round.slang" 1071 | } 1072 | }, 1073 | "end": "\\)", 1074 | "endCaptures": { 1075 | "0": { 1076 | "name": "punctuation.section.parens.end.bracket.round.slang" 1077 | } 1078 | }, 1079 | "patterns": [ 1080 | { 1081 | "include": "#function-call-innards" 1082 | } 1083 | ] 1084 | }, 1085 | { 1086 | "include": "#block_innards" 1087 | } 1088 | ] 1089 | }, 1090 | "function-innards": { 1091 | "patterns": [ 1092 | { 1093 | "include": "#comments" 1094 | }, 1095 | { 1096 | "include": "#storage_types" 1097 | }, 1098 | { 1099 | "include": "#operators" 1100 | }, 1101 | { 1102 | "include": "#vararg_ellipses" 1103 | }, 1104 | { 1105 | "name": "meta.function.definition.parameters.slang", 1106 | "begin": "(?x)\n(?!(?:while|for|do|if|else|switch|catch|enumerate|return|typeid|alignof|alignas|sizeof|countof|where|(__)?(f|b)wd_diff|__dispatch_kernel|no_diff|__constref|expand|each)\\s*\\()\n(\n(?:[A-Za-z_][A-Za-z0-9_]*+|::)++ # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()", 1107 | "beginCaptures": { 1108 | "1": { 1109 | "name": "entity.name.function.slang" 1110 | }, 1111 | "2": { 1112 | "name": "punctuation.section.parameters.begin.bracket.round.slang" 1113 | } 1114 | }, 1115 | "end": "\\)", 1116 | "endCaptures": { 1117 | "0": { 1118 | "name": "punctuation.section.parameters.end.bracket.round.slang" 1119 | } 1120 | }, 1121 | "patterns": [ 1122 | { 1123 | "include": "#probably_a_parameter" 1124 | }, 1125 | { 1126 | "include": "#function-innards" 1127 | } 1128 | ] 1129 | }, 1130 | { 1131 | "begin": "\\(", 1132 | "beginCaptures": { 1133 | "0": { 1134 | "name": "punctuation.section.parens.begin.bracket.round.slang" 1135 | } 1136 | }, 1137 | "end": "\\)", 1138 | "endCaptures": { 1139 | "0": { 1140 | "name": "punctuation.section.parens.end.bracket.round.slang" 1141 | } 1142 | }, 1143 | "patterns": [ 1144 | { 1145 | "include": "#function-innards" 1146 | } 1147 | ] 1148 | }, 1149 | { 1150 | "include": "$base" 1151 | } 1152 | ] 1153 | }, 1154 | "inline_comment": { 1155 | "match": "(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/))", 1156 | "captures": { 1157 | "1": { 1158 | "name": "comment.block.slang punctuation.definition.comment.begin.slang" 1159 | }, 1160 | "2": { 1161 | "name": "comment.block.slang" 1162 | }, 1163 | "3": { 1164 | "patterns": [ 1165 | { 1166 | "match": "\\*\\/", 1167 | "name": "comment.block.slang punctuation.definition.comment.end.slang" 1168 | }, 1169 | { 1170 | "match": "\\*", 1171 | "name": "comment.block.slang" 1172 | } 1173 | ] 1174 | } 1175 | } 1176 | }, 1177 | "line_continuation_character": { 1178 | "patterns": [ 1179 | { 1180 | "match": "(\\\\)\\n", 1181 | "captures": { 1182 | "1": { 1183 | "name": "constant.character.escape.line-continuation.slang" 1184 | } 1185 | } 1186 | } 1187 | ] 1188 | }, 1189 | "member_access": { 1190 | "match": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:[a-zA-Z_]\\w*\\s*(?:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*(\\b(?!(?:atomic_uint_least64_t|atomic_uint_least16_t|atomic_uint_least32_t|atomic_uint_least8_t|atomic_int_least16_t|atomic_uint_fast64_t|atomic_uint_fast32_t|atomic_int_least64_t|atomic_int_least32_t|pthread_rwlockattr_t|atomic_uint_fast16_t|pthread_mutexattr_t|atomic_int_fast16_t|atomic_uint_fast8_t|atomic_int_fast64_t|atomic_int_least8_t|atomic_int_fast32_t|atomic_int_fast8_t|pthread_condattr_t|atomic_uintptr_t|atomic_ptrdiff_t|pthread_rwlock_t|atomic_uintmax_t|pthread_mutex_t|atomic_intmax_t|atomic_intptr_t|atomic_char32_t|atomic_char16_t|pthread_attr_t|atomic_wchar_t|uint_least64_t|uint_least32_t|uint_least16_t|pthread_cond_t|pthread_once_t|uint_fast64_t|uint_fast16_t|atomic_size_t|uint_least8_t|int_least64_t|int_least32_t|int_least16_t|pthread_key_t|atomic_ullong|atomic_ushort|uint_fast32_t|atomic_schar|atomic_short|uint_fast8_t|int_fast64_t|int_fast32_t|int_fast16_t|atomic_ulong|atomic_llong|int_least8_t|atomic_uchar|memory_order|suseconds_t|int_fast8_t|atomic_bool|atomic_char|atomic_uint|atomic_long|atomic_int|useconds_t|_Imaginary|blksize_t|pthread_t|in_addr_t|uintptr_t|in_port_t|uintmax_t|uintmax_t|blkcnt_t|uint16_t|unsigned|_Complex|uint32_t|intptr_t|intmax_t|intmax_t|uint64_t|u_quad_t|int64_t|int32_t|ssize_t|caddr_t|clock_t|uint8_t|u_short|swblk_t|segsz_t|int16_t|fixpt_t|daddr_t|nlink_t|qaddr_t|size_t|time_t|mode_t|signed|quad_t|ushort|u_long|u_char|double|int8_t|ino_t|uid_t|pid_t|_Bool|float|dev_t|div_t|short|gid_t|off_t|u_int|key_t|id_t|uint|long|void|char|bool|id_t|int)\\b)[a-zA-Z_]\\w*\\b(?!\\())", 1191 | "captures": { 1192 | "1": { 1193 | "name": "variable.other.object.access.slang" 1194 | }, 1195 | "2": { 1196 | "name": "punctuation.separator.dot-access.slang" 1197 | }, 1198 | "3": { 1199 | "name": "punctuation.separator.pointer-access.slang" 1200 | }, 1201 | "4": { 1202 | "patterns": [ 1203 | { 1204 | "include": "#member_access" 1205 | }, 1206 | { 1207 | "include": "#method_access" 1208 | }, 1209 | { 1210 | "match": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))", 1211 | "captures": { 1212 | "1": { 1213 | "name": "variable.other.object.access.slang" 1214 | }, 1215 | "2": { 1216 | "name": "punctuation.separator.dot-access.slang" 1217 | }, 1218 | "3": { 1219 | "name": "punctuation.separator.pointer-access.slang" 1220 | } 1221 | } 1222 | } 1223 | ] 1224 | }, 1225 | "5": { 1226 | "name": "variable.other.member.slang" 1227 | } 1228 | } 1229 | }, 1230 | "method_access": { 1231 | "contentName": "meta.function-call.member.slang", 1232 | "begin": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:[a-zA-Z_]\\w*\\s*(?:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*([a-zA-Z_]\\w*)(\\()", 1233 | "beginCaptures": { 1234 | "1": { 1235 | "name": "variable.other.object.access.slang" 1236 | }, 1237 | "2": { 1238 | "name": "punctuation.separator.dot-access.slang" 1239 | }, 1240 | "3": { 1241 | "name": "punctuation.separator.pointer-access.slang" 1242 | }, 1243 | "4": { 1244 | "patterns": [ 1245 | { 1246 | "include": "#member_access" 1247 | }, 1248 | { 1249 | "include": "#method_access" 1250 | }, 1251 | { 1252 | "match": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))", 1253 | "captures": { 1254 | "1": { 1255 | "name": "variable.other.object.access.slang" 1256 | }, 1257 | "2": { 1258 | "name": "punctuation.separator.dot-access.slang" 1259 | }, 1260 | "3": { 1261 | "name": "punctuation.separator.pointer-access.slang" 1262 | } 1263 | } 1264 | } 1265 | ] 1266 | }, 1267 | "5": { 1268 | "name": "entity.name.function.member.slang" 1269 | }, 1270 | "6": { 1271 | "name": "punctuation.section.arguments.begin.bracket.round.function.member.slang" 1272 | } 1273 | }, 1274 | "end": "(\\))", 1275 | "endCaptures": { 1276 | "1": { 1277 | "name": "punctuation.section.arguments.end.bracket.round.function.member.slang" 1278 | } 1279 | }, 1280 | "patterns": [ 1281 | { 1282 | "include": "#function-call-innards" 1283 | } 1284 | ] 1285 | }, 1286 | "numbers": { 1287 | "match": "(?>=|\\|=", 1567 | "name": "keyword.operator.assignment.compound.bitwise.slang" 1568 | }, 1569 | { 1570 | "match": "<<|>>", 1571 | "name": "keyword.operator.bitwise.shift.slang" 1572 | }, 1573 | { 1574 | "match": "!=|<=|>=|==|<|>", 1575 | "name": "keyword.operator.comparison.slang" 1576 | }, 1577 | { 1578 | "match": "&&|!|\\|\\|", 1579 | "name": "keyword.operator.logical.slang" 1580 | }, 1581 | { 1582 | "match": "&|\\||\\^|~", 1583 | "name": "keyword.operator.slang" 1584 | }, 1585 | { 1586 | "match": "=", 1587 | "name": "keyword.operator.assignment.slang" 1588 | }, 1589 | { 1590 | "match": "%|\\*|/|-|\\+", 1591 | "name": "keyword.operator.slang" 1592 | }, 1593 | { 1594 | "begin": "(\\?)", 1595 | "beginCaptures": { 1596 | "1": { 1597 | "name": "keyword.operator.ternary.slang" 1598 | } 1599 | }, 1600 | "end": "(:)", 1601 | "endCaptures": { 1602 | "1": { 1603 | "name": "keyword.operator.ternary.slang" 1604 | } 1605 | }, 1606 | "patterns": [ 1607 | { 1608 | "include": "#function-call-innards" 1609 | }, 1610 | { 1611 | "include": "$base" 1612 | } 1613 | ] 1614 | } 1615 | ] 1616 | }, 1617 | "parens": { 1618 | "name": "meta.parens.slang", 1619 | "begin": "\\(", 1620 | "beginCaptures": { 1621 | "0": { 1622 | "name": "punctuation.section.parens.begin.bracket.round.slang" 1623 | } 1624 | }, 1625 | "end": "\\)", 1626 | "endCaptures": { 1627 | "0": { 1628 | "name": "punctuation.section.parens.end.bracket.round.slang" 1629 | } 1630 | }, 1631 | "patterns": [ 1632 | { 1633 | "include": "$base" 1634 | } 1635 | ] 1636 | }, 1637 | "parens-block": { 1638 | "name": "meta.parens.block.slang", 1639 | "begin": "\\(", 1640 | "beginCaptures": { 1641 | "0": { 1642 | "name": "punctuation.section.parens.begin.bracket.round.slang" 1643 | } 1644 | }, 1645 | "end": "\\)", 1646 | "endCaptures": { 1647 | "0": { 1648 | "name": "punctuation.section.parens.end.bracket.round.slang" 1649 | } 1650 | }, 1651 | "patterns": [ 1652 | { 1653 | "include": "#block_innards" 1654 | }, 1655 | { 1656 | "match": "(?-mix:(?=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)", 2004 | "end": "(?<=\\))(?!\\w)|(?=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()", 2094 | "beginCaptures": { 2095 | "1": { 2096 | "name": "entity.name.function.slang" 2097 | }, 2098 | "2": { 2099 | "name": "punctuation.section.arguments.begin.bracket.round.slang" 2100 | } 2101 | }, 2102 | "end": "(\\))|(?\\]\\)])\\s*([a-zA-Z_]\\w*)\\s*(?=(?:\\[\\]\\s*)?(?:,|\\)))", 2798 | "captures": { 2799 | "1": { 2800 | "name": "variable.parameter.probably.slang" 2801 | } 2802 | } 2803 | }, 2804 | "static_assert": { 2805 | "begin": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", 2806 | "beginCaptures": { 2807 | "1": { 2808 | "patterns": [ 2809 | { 2810 | "include": "#inline_comment" 2811 | } 2812 | ] 2813 | }, 2814 | "2": { 2815 | "name": "comment.block.slang punctuation.definition.comment.begin.slang" 2816 | }, 2817 | "3": { 2818 | "name": "comment.block.slang" 2819 | }, 2820 | "4": { 2821 | "patterns": [ 2822 | { 2823 | "match": "\\*\\/", 2824 | "name": "comment.block.slang punctuation.definition.comment.end.slang" 2825 | }, 2826 | { 2827 | "match": "\\*", 2828 | "name": "comment.block.slang" 2829 | } 2830 | ] 2831 | }, 2832 | "5": { 2833 | "name": "keyword.other.static_assert.slang" 2834 | }, 2835 | "6": { 2836 | "patterns": [ 2837 | { 2838 | "include": "#inline_comment" 2839 | } 2840 | ] 2841 | }, 2842 | "7": { 2843 | "name": "comment.block.slang punctuation.definition.comment.begin.slang" 2844 | }, 2845 | "8": { 2846 | "name": "comment.block.slang" 2847 | }, 2848 | "9": { 2849 | "patterns": [ 2850 | { 2851 | "match": "\\*\\/", 2852 | "name": "comment.block.slang punctuation.definition.comment.end.slang" 2853 | }, 2854 | { 2855 | "match": "\\*", 2856 | "name": "comment.block.slang" 2857 | } 2858 | ] 2859 | }, 2860 | "10": { 2861 | "name": "punctuation.section.arguments.begin.bracket.round.static_assert.slang" 2862 | } 2863 | }, 2864 | "end": "(\\))", 2865 | "endCaptures": { 2866 | "1": { 2867 | "name": "punctuation.section.arguments.end.bracket.round.static_assert.slang" 2868 | } 2869 | }, 2870 | "patterns": [ 2871 | { 2872 | "name": "meta.static_assert.message.slang", 2873 | "begin": "(,)\\s*(?=(?:L|u8|u|U\\s*\\\")?)", 2874 | "beginCaptures": { 2875 | "1": { 2876 | "name": "punctuation.separator.delimiter.comma.slang" 2877 | } 2878 | }, 2879 | "end": "(?=\\))", 2880 | "patterns": [ 2881 | { 2882 | "include": "#string_context" 2883 | } 2884 | ] 2885 | }, 2886 | { 2887 | "include": "#evaluation_context" 2888 | } 2889 | ] 2890 | }, 2891 | "storage_types": { 2892 | "patterns": [ 2893 | { 2894 | "match": "(?-mix:(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:\\n|$)", 2921 | "captures": { 2922 | "1": { 2923 | "patterns": [ 2924 | { 2925 | "include": "#inline_comment" 2926 | } 2927 | ] 2928 | }, 2929 | "2": { 2930 | "name": "comment.block.slang punctuation.definition.comment.begin.slang" 2931 | }, 2932 | "3": { 2933 | "name": "comment.block.slang" 2934 | }, 2935 | "4": { 2936 | "patterns": [ 2937 | { 2938 | "match": "\\*\\/", 2939 | "name": "comment.block.slang punctuation.definition.comment.end.slang" 2940 | }, 2941 | { 2942 | "match": "\\*", 2943 | "name": "comment.block.slang" 2944 | } 2945 | ] 2946 | } 2947 | } 2948 | }, 2949 | { 2950 | "include": "#comments" 2951 | }, 2952 | { 2953 | "begin": "(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))\\()", 2954 | "beginCaptures": { 2955 | "1": { 2956 | "name": "punctuation.section.parens.begin.bracket.round.assembly.slang" 2957 | }, 2958 | "2": { 2959 | "patterns": [ 2960 | { 2961 | "include": "#inline_comment" 2962 | } 2963 | ] 2964 | }, 2965 | "3": { 2966 | "name": "comment.block.slang punctuation.definition.comment.begin.slang" 2967 | }, 2968 | "4": { 2969 | "name": "comment.block.slang" 2970 | }, 2971 | "5": { 2972 | "patterns": [ 2973 | { 2974 | "match": "\\*\\/", 2975 | "name": "comment.block.slang punctuation.definition.comment.end.slang" 2976 | }, 2977 | { 2978 | "match": "\\*", 2979 | "name": "comment.block.slang" 2980 | } 2981 | ] 2982 | } 2983 | }, 2984 | "end": "(\\))", 2985 | "endCaptures": { 2986 | "1": { 2987 | "name": "punctuation.section.parens.end.bracket.round.assembly.slang" 2988 | } 2989 | }, 2990 | "patterns": [ 2991 | { 2992 | "name": "string.quoted.double.slang", 2993 | "contentName": "meta.embedded.assembly.slang", 2994 | "begin": "(R?)(\")", 2995 | "beginCaptures": { 2996 | "1": { 2997 | "name": "meta.encoding.slang" 2998 | }, 2999 | "2": { 3000 | "name": "punctuation.definition.string.begin.assembly.slang" 3001 | } 3002 | }, 3003 | "end": "(\")", 3004 | "endCaptures": { 3005 | "1": { 3006 | "name": "punctuation.definition.string.end.assembly.slang" 3007 | } 3008 | }, 3009 | "patterns": [ 3010 | { 3011 | "include": "#backslash_escapes" 3012 | }, 3013 | { 3014 | "include": "#string_escaped_char" 3015 | } 3016 | ] 3017 | }, 3018 | { 3019 | "begin": "(\\()", 3020 | "beginCaptures": { 3021 | "1": { 3022 | "name": "punctuation.section.parens.begin.bracket.round.assembly.inner.slang" 3023 | } 3024 | }, 3025 | "end": "(\\))", 3026 | "endCaptures": { 3027 | "1": { 3028 | "name": "punctuation.section.parens.end.bracket.round.assembly.inner.slang" 3029 | } 3030 | }, 3031 | "patterns": [ 3032 | { 3033 | "include": "#evaluation_context" 3034 | } 3035 | ] 3036 | }, 3037 | { 3038 | "match": "\\[((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))([a-zA-Z_]\\w*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))\\]", 3039 | "captures": { 3040 | "1": { 3041 | "patterns": [ 3042 | { 3043 | "include": "#inline_comment" 3044 | } 3045 | ] 3046 | }, 3047 | "2": { 3048 | "name": "comment.block.slang punctuation.definition.comment.begin.slang" 3049 | }, 3050 | "3": { 3051 | "name": "comment.block.slang" 3052 | }, 3053 | "4": { 3054 | "patterns": [ 3055 | { 3056 | "match": "\\*\\/", 3057 | "name": "comment.block.slang punctuation.definition.comment.end.slang" 3058 | }, 3059 | { 3060 | "match": "\\*", 3061 | "name": "comment.block.slang" 3062 | } 3063 | ] 3064 | }, 3065 | "5": { 3066 | "name": "variable.other.asm.label.slang" 3067 | }, 3068 | "6": { 3069 | "patterns": [ 3070 | { 3071 | "include": "#inline_comment" 3072 | } 3073 | ] 3074 | }, 3075 | "7": { 3076 | "name": "comment.block.slang punctuation.definition.comment.begin.slang" 3077 | }, 3078 | "8": { 3079 | "name": "comment.block.slang" 3080 | }, 3081 | "9": { 3082 | "patterns": [ 3083 | { 3084 | "match": "\\*\\/", 3085 | "name": "comment.block.slang punctuation.definition.comment.end.slang" 3086 | }, 3087 | { 3088 | "match": "\\*", 3089 | "name": "comment.block.slang" 3090 | } 3091 | ] 3092 | } 3093 | } 3094 | }, 3095 | { 3096 | "match": ":", 3097 | "name": "punctuation.separator.delimiter.colon.assembly.slang" 3098 | }, 3099 | { 3100 | "include": "#comments" 3101 | } 3102 | ] 3103 | } 3104 | ] 3105 | } 3106 | ] 3107 | }, 3108 | "string_escaped_char": { 3109 | "patterns": [ 3110 | { 3111 | "match": "(?x)\\\\ (\n\\\\\t\t\t |\n[abefnprtv'\"?] |\n[0-3]\\d{,2}\t |\n[4-7]\\d?\t\t|\nx[a-fA-F0-9]{,2} |\nu[a-fA-F0-9]{,4} |\nU[a-fA-F0-9]{,8} )", 3112 | "name": "constant.character.escape.slang" 3113 | }, 3114 | { 3115 | "match": "\\\\.", 3116 | "name": "invalid.illegal.unknown-escape.slang" 3117 | } 3118 | ] 3119 | }, 3120 | "string_placeholder": { 3121 | "patterns": [ 3122 | { 3123 | "match": "(?x) %\n(\\d+\\$)?\t\t\t\t\t\t # field (argument #)\n[#0\\- +']*\t\t\t\t\t\t # flags\n[,;:_]?\t\t\t\t\t\t\t # separator character (AltiVec)\n((-?\\d+)|\\*(-?\\d+\\$)?)?\t\t # minimum field width\n(\\.((-?\\d+)|\\*(-?\\d+\\$)?)?)?\t# precision\n(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)? # length modifier\n[diouxXDOUeEfFgGaACcSspn%]\t\t # conversion type", 3124 | "name": "constant.other.placeholder.slang" 3125 | }, 3126 | { 3127 | "match": "(%)(?!\"\\s*(PRI|SCN))", 3128 | "captures": { 3129 | "1": { 3130 | "name": "invalid.illegal.placeholder.slang" 3131 | } 3132 | } 3133 | } 3134 | ] 3135 | }, 3136 | "strings": { 3137 | "patterns": [ 3138 | { 3139 | "begin": "((?:u|u8|U|L)?R)\"(?:([^ ()\\\\\\t]{0,16})|([^ ()\\\\\\t]*))\\(", 3140 | "beginCaptures": { 3141 | "0": { 3142 | "name": "punctuation.definition.string.begin" 3143 | }, 3144 | "1": { 3145 | "name": "meta.encoding" 3146 | }, 3147 | "3": { 3148 | "name": "invalid.illegal.delimiter-too-long" 3149 | } 3150 | }, 3151 | "end": "\\)\\2(\\3)\"", 3152 | "endCaptures": { 3153 | "0": { 3154 | "name": "punctuation.definition.string.end" 3155 | }, 3156 | "1": { 3157 | "name": "invalid.illegal.delimiter-too-long" 3158 | } 3159 | }, 3160 | "name": "string.quoted.double.raw" 3161 | }, 3162 | { 3163 | "begin": "((?:u|u8|U|L)?)?\"", 3164 | "beginCaptures": { 3165 | "0": { 3166 | "name": "punctuation.definition.string.begin.slang" 3167 | } 3168 | }, 3169 | "end": "\"", 3170 | "endCaptures": { 3171 | "0": { 3172 | "name": "punctuation.definition.string.end.slang" 3173 | } 3174 | }, 3175 | "name": "string.quoted.double.slang", 3176 | "patterns": [ 3177 | { 3178 | "include": "#string_escaped_char" 3179 | }, 3180 | { 3181 | "include": "#string_placeholder" 3182 | }, 3183 | { 3184 | "include": "#line_continuation_character" 3185 | } 3186 | ] 3187 | }, 3188 | { 3189 | "begin": "'", 3190 | "beginCaptures": { 3191 | "0": { 3192 | "name": "punctuation.definition.string.begin.slang" 3193 | } 3194 | }, 3195 | "end": "'", 3196 | "endCaptures": { 3197 | "0": { 3198 | "name": "punctuation.definition.string.end.slang" 3199 | } 3200 | }, 3201 | "name": "string.quoted.single.slang", 3202 | "patterns": [ 3203 | { 3204 | "include": "#string_escaped_char" 3205 | }, 3206 | { 3207 | "include": "#line_continuation_character" 3208 | } 3209 | ] 3210 | } 3211 | ] 3212 | }, 3213 | "switch_conditional_parentheses": { 3214 | "name": "meta.conditional.switch.slang", 3215 | "begin": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", 3216 | "beginCaptures": { 3217 | "1": { 3218 | "patterns": [ 3219 | { 3220 | "include": "#inline_comment" 3221 | } 3222 | ] 3223 | }, 3224 | "2": { 3225 | "name": "comment.block.slang punctuation.definition.comment.begin.slang" 3226 | }, 3227 | "3": { 3228 | "name": "comment.block.slang" 3229 | }, 3230 | "4": { 3231 | "patterns": [ 3232 | { 3233 | "match": "\\*\\/", 3234 | "name": "comment.block.slang punctuation.definition.comment.end.slang" 3235 | }, 3236 | { 3237 | "match": "\\*", 3238 | "name": "comment.block.slang" 3239 | } 3240 | ] 3241 | }, 3242 | "5": { 3243 | "name": "punctuation.section.parens.begin.bracket.round.conditional.switch.slang" 3244 | } 3245 | }, 3246 | "end": "(\\))", 3247 | "endCaptures": { 3248 | "1": { 3249 | "name": "punctuation.section.parens.end.bracket.round.conditional.switch.slang" 3250 | } 3251 | }, 3252 | "patterns": [ 3253 | { 3254 | "include": "#evaluation_context" 3255 | }, 3256 | { 3257 | "include": "#c_conditional_context" 3258 | } 3259 | ] 3260 | }, 3261 | "switch_statement": { 3262 | "name": "meta.block.switch.slang", 3263 | "begin": "(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?|\\?\\?>)|(?=[;>\\[\\]=]))", 3298 | "patterns": [ 3299 | { 3300 | "name": "meta.head.switch.slang", 3301 | "begin": "\\G ?", 3302 | "end": "((?:\\{|<%|\\?\\?<|(?=;)))", 3303 | "endCaptures": { 3304 | "1": { 3305 | "name": "punctuation.section.block.begin.bracket.curly.switch.slang" 3306 | } 3307 | }, 3308 | "patterns": [ 3309 | { 3310 | "include": "#switch_conditional_parentheses" 3311 | }, 3312 | { 3313 | "include": "$self" 3314 | } 3315 | ] 3316 | }, 3317 | { 3318 | "name": "meta.body.switch.slang", 3319 | "begin": "(?<=\\{|<%|\\?\\?<)", 3320 | "end": "(\\}|%>|\\?\\?>)", 3321 | "endCaptures": { 3322 | "1": { 3323 | "name": "punctuation.section.block.end.bracket.curly.switch.slang" 3324 | } 3325 | }, 3326 | "patterns": [ 3327 | { 3328 | "include": "#default_statement" 3329 | }, 3330 | { 3331 | "include": "#case_statement" 3332 | }, 3333 | { 3334 | "include": "$self" 3335 | }, 3336 | { 3337 | "include": "#block_innards" 3338 | } 3339 | ] 3340 | }, 3341 | { 3342 | "name": "meta.tail.switch.slang", 3343 | "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", 3344 | "end": "[\\s\\n]*(?=;)", 3345 | "patterns": [ 3346 | { 3347 | "include": "$self" 3348 | } 3349 | ] 3350 | } 3351 | ] 3352 | }, 3353 | "vararg_ellipses": { 3354 | "match": "(?