summaryrefslogtreecommitdiff
path: root/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/slangd.lua
blob: 642b4ddf8cd33cacd902c461e1a8d1027428e9be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
local util = require 'lspconfig.util'
local bin_name = 'slangd'

if vim.fn.has 'win32' == 1 then
  bin_name = 'slangd.exe'
end

return {
  default_config = {
    cmd = { bin_name },
    filetypes = { 'hlsl', 'shaderslang' },
    root_dir = util.find_git_ancestor,
    single_file_support = true,
  },
  docs = {
    description = [[
https://github.com/shader-slang/slang

The `slangd` binary can be downloaded as part of [slang releases](https://github.com/shader-slang/slang/releases) or
by [building `slang` from source](https://github.com/shader-slang/slang/blob/master/docs/building.md).

The server can be configured by passing a "settings" object to `slangd.setup{}`:

```lua
require('lspconfig').slangd.setup{
  settings = {
    slang = {
      predefinedMacros = {"MY_VALUE_MACRO=1"},
      inlayHints = {
        deducedTypes = true,
        parameterNames = true,
      }
    }
  }
}
```
Available options are documented [here](https://github.com/shader-slang/slang-vscode-extension/tree/main?tab=readme-ov-file#configurations)
or in more detail [here](https://github.com/shader-slang/slang-vscode-extension/blob/main/package.json#L70).
]],
    default_config = {
      root_dir = [[util.find_git_ancestor]],
    },
  },
}