diff options
| author | Rui Chen <77432836+sharpchen@users.noreply.github.com> | 2024-12-17 07:22:18 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-17 15:22:18 +0800 |
| commit | 495a7f16f6eb1d3e9b2b976c77b51ab9f970046d (patch) | |
| tree | 30804cddce6afc7ceb09fe152fe0b06257f14a76 /lua | |
| parent | fix(ruff, ruff_lsp, crystalline, janet_lsp): returning a function from root p... (diff) | |
| download | nvim-lspconfig-495a7f16f6eb1d3e9b2b976c77b51ab9f970046d.tar nvim-lspconfig-495a7f16f6eb1d3e9b2b976c77b51ab9f970046d.tar.gz nvim-lspconfig-495a7f16f6eb1d3e9b2b976c77b51ab9f970046d.tar.bz2 nvim-lspconfig-495a7f16f6eb1d3e9b2b976c77b51ab9f970046d.tar.lz nvim-lspconfig-495a7f16f6eb1d3e9b2b976c77b51ab9f970046d.tar.xz nvim-lspconfig-495a7f16f6eb1d3e9b2b976c77b51ab9f970046d.tar.zst nvim-lspconfig-495a7f16f6eb1d3e9b2b976c77b51ab9f970046d.zip | |
feat(msbuild): config instruction for filetypes (#3516)
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/configs/msbuild_project_tools_server.lua | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/lua/lspconfig/configs/msbuild_project_tools_server.lua b/lua/lspconfig/configs/msbuild_project_tools_server.lua index f9abba3e..4c4cbf79 100644 --- a/lua/lspconfig/configs/msbuild_project_tools_server.lua +++ b/lua/lspconfig/configs/msbuild_project_tools_server.lua @@ -2,7 +2,7 @@ local host_dll_name = 'MSBuildProjectTools.LanguageServer.Host.dll' return { default_config = { - filetypes = { 'xml.csproj', 'xml.fsproj', 'sln' }, + filetypes = { 'msbuild' }, root_dir = function(fname) return vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]) end, @@ -10,7 +10,7 @@ return { cmd = { 'dotnet', host_dll_name }, }, docs = { - description = [[ + 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. @@ -22,6 +22,26 @@ lspconfig.msbuild_project_tools_server.setup { } ``` -]], +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' }) +``` +]=], }, } |
