ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Slang

by jwortmann ST4 New

Slang shading language support for Sublime Text

Details

Installs

  • Total 2
  • Win 2
  • Mac 0
  • Linux 0
Sep 6 Sep 5 Sep 4 Sep 3 Sep 2 Sep 1 Aug 31 Aug 30 Aug 29 Aug 28 Aug 27 Aug 26 Aug 25 Aug 24 Aug 23 Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6 Aug 5 Aug 4 Aug 3 Aug 2 Aug 1 Jul 31 Jul 30 Jul 29 Jul 28 Jul 27 Jul 26 Jul 25 Jul 24
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Slang Package for Sublime Text

Syntax highlighting support for the Slang shading language in Sublime Text.

Optional LSP Configuration

The Slang compiler from https://github.com/shader-slang/slang/releases includes an LSP server executable slangd that can be used with Sublime's LSP package to provide auto-completions, linting, etc.

Open Preferences: LSP Server Configuration from the command palette and add the following example config:

Error: language “jsonc” is not supported
{
    "slang-lsp": {
        "enabled": true,
        "command": ["path/to/bin/slangd"],
        "selector": "source.slang",
        "settings": {
            // 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.
            "slang.predefinedMacros": [],
            // 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.
            "slang.searchInAllWorkspaceDirectories": true,
            // 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).
            "slang.additionalSearchPaths": [],
            // Controls whether or not to enable commit characters for selecting
            // an auto completion item in addition to pressing enter.
            // Options:
            //   "off" - disabled.
            //   "memberOnly" - use commit characters in a member list only.
            //   "on" - use commit characters for all types of completions.
            // Note: this setting has currently no effect, because commit characters
            // are not supported by Sublime LSP.
            "slang.enableCommitCharactersInAutoCompletion": "membersOnly",
            // Controls whether or not to format code automatically while typing.
            // Requires clang-format to be discoverable from PATH.
            "slang.format.enableFormatOnType": true,
            // The location of clang-format for auto formatting, including the
            // executable name. If left unspecified, will attempt to find
            // `clang-format` under `PATH`.
            "slang.format.clangFormatLocation": "",
            // The `-style` argument to pass to clang-format, without quotes.
            // Examples: `Microsoft`, `LLVM`, `file:fileName`.
            "slang.format.clangFormatStyle": "file",
            // The `-fallback-style` argument to pass to clang-format, without quotes.
            // Examples: `Microsoft`, `LLVM`, `file:fileName`.
            "slang.format.clangFormatFallbackStyle": "{BasedOnStyle: Microsoft, BreakBeforeBraces: Allman, ColumnLimit: 0}",
            // Controls whether the extension is allowed to make line-break changes
            // when reformatting the code on typing.
            "slang.format.allowLineBreakChangesInOnTypeFormatting": false,
            // Controls whether the extension is allowed to make line-break changes
            // when doing range formatting, such as formatting on paste or on command.
            "slang.format.allowLineBreakChangesInRangeFormatting": false,
            // Enable inlay hints for duduced decl types, e.g. the deduced type in
            // `var i = 2`
            "slang.inlayHints.deducedTypes": true,
            // Enable inlay hints for parameter names at call sites.
            "slang.inlayHints.parameterNames": true,
            // Controls the workspace flavor of the language server.
            // Options: "standard", "vfx"
            "slang.workspaceFlavor": "standard",
            // The assumed Slang language version for source files that do not
            // contain a `#language` directive. The empty default follows the
            // compiler's own default version. Set this to match the version you
            // build with (for example a global `-std`/`-language-version` option)
            // so the editor does not report false errors on directive-less files.
            // A per-file `#language` directive always overrides this setting.
            // Options:
            //   "" - Use the compiler's default language version.
            //   "2018" - Legacy Slang (2018) language rules.
            //   "2025" - Slang 2025 language rules.
            //   "2026" - Slang 2026 language rules.
            //   "latest" - The latest Slang language rules (currently 2026).
            "slang.predefinedLanguageVersion": "",
        }
    },
}