Skip to content

Commit

Permalink
feat: add twig-language-server
Browse files Browse the repository at this point in the history
  • Loading branch information
huesersohn committed Dec 19, 2023
1 parent e85816c commit 102649d
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions lua/lspconfig/server_configurations/twig_language_server.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
local util = require 'lspconfig.util'

return {
default_config = {
cmd = { 'twig-language-server', '--stdio' },
filetypes = { 'twig' },
root_dir = function(pattern)
local cwd = vim.loop.cwd()
local root = util.root_pattern('composer.json', '.git')(pattern)

-- prefer cwd if root is a descendant
return util.path.is_descendant(cwd, root) and cwd or root
end,
},
docs = {
description = [[
https://github.com/moetelo/twiggy
Can be installed via Mason, which uses the server bundled with the VSCode extension.
```
]],
default_config = {
root_dir = [[root_pattern("composer.json", ".git")]],
},
},
}

0 comments on commit 102649d

Please sign in to comment.