-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e85816c
commit 102649d
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
lua/lspconfig/server_configurations/twig_language_server.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")]], | ||
}, | ||
}, | ||
} |