aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/configs/msbuild_project_tools_server.lua
blob: 54d14fc24f086c269a2175c30be4115b9084c4f2 (plain) (blame)
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
45
46
local host_dll_name = 'MSBuildProjectTools.LanguageServer.Host.dll'
local util = require 'lspconfig.util'

return {
  default_config = {
    filetypes = { 'msbuild' },
    root_dir = util.root_pattern('*.sln', '*.slnx', '*.*proj', '.git'),
    init_options = {},
    cmd = { 'dotnet', host_dll_name },
  },
  docs = {
    description = [=[
https://github.com/tintoy/msbuild-project-tools-server/

MSBuild Project Tools Server can be installed by following the README.MD on the above repository.

Example config:
```lua
lspconfig.msbuild_project_tools_server.setup {
  cmd = {'dotnet', '/path/to/server/MSBuildProjectTools.LanguageServer.Host.dll'}
}
```

There's no builtin filetypes for msbuild files, would require some filetype aliases:

```lua
vim.filetype.add({
  extension = {
    props = 'msbuild',
    tasks = 'msbuild',
    targets = 'msbuild',
  },
  pattern = {
    [ [[.*\..*proj]] ] = 'msbuild',
  },
})
```

Optionally tell treesitter to treat `msbuild` as `xml` so you can get syntax highlighting if you have the treesitter-xml-parser installed.

```lua
vim.treesitter.language.register('xml', { 'msbuild' })
```
]=],
  },
}