mirror of
https://github.com/neovim/nvim-lspconfig.git
synced 2026-05-05 16:46:11 +02:00
Problem: Currently the only root marker for slangd is .git Solution: As mentioned [here](https://github.com/shader-slang/slang-vs-extension?tab=readme-ov-file#configurations), slangdconfig.json and .clangformat could be used as root markers
32 lines
1.1 KiB
Lua
32 lines
1.1 KiB
Lua
---@brief
|
|
---
|
|
--- 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 vim.lsp.config('slangd'):
|
|
---
|
|
--- ```lua
|
|
--- vim.lsp.config('slangd', {
|
|
--- 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).
|
|
|
|
---@type vim.lsp.Config
|
|
return {
|
|
cmd = { 'slangd' },
|
|
filetypes = { 'hlsl', 'shaderslang' },
|
|
root_markers = { 'slangdconfig.json', '.clang-format', '.git' },
|
|
}
|