aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/server_configurations/angularls.lua
diff options
context:
space:
mode:
authorMichael Lingelbach <m.j.lbach@gmail.com>2021-12-10 10:22:10 -0800
committerGitHub <noreply@github.com>2021-12-10 10:22:10 -0800
commit026ab6bd54075cc8e095f9040f7912ffb708864d (patch)
tree38898842be3e84e5bed0f385fc177a5f05329ac9 /lua/lspconfig/server_configurations/angularls.lua
parentdocs: update server_configurations.md (diff)
parentchore(docs): add a section about windows shims (diff)
downloadnvim-lspconfig-026ab6bd54075cc8e095f9040f7912ffb708864d.tar
nvim-lspconfig-026ab6bd54075cc8e095f9040f7912ffb708864d.tar.gz
nvim-lspconfig-026ab6bd54075cc8e095f9040f7912ffb708864d.tar.bz2
nvim-lspconfig-026ab6bd54075cc8e095f9040f7912ffb708864d.tar.lz
nvim-lspconfig-026ab6bd54075cc8e095f9040f7912ffb708864d.tar.xz
nvim-lspconfig-026ab6bd54075cc8e095f9040f7912ffb708864d.tar.zst
nvim-lspconfig-026ab6bd54075cc8e095f9040f7912ffb708864d.zip
Merge pull request #1522 from kylo252/win-compat
Diffstat (limited to 'lua/lspconfig/server_configurations/angularls.lua')
-rw-r--r--lua/lspconfig/server_configurations/angularls.lua24
1 files changed, 16 insertions, 8 deletions
diff --git a/lua/lspconfig/server_configurations/angularls.lua b/lua/lspconfig/server_configurations/angularls.lua
index 321c97cb..4d30de71 100644
--- a/lua/lspconfig/server_configurations/angularls.lua
+++ b/lua/lspconfig/server_configurations/angularls.lua
@@ -11,16 +11,24 @@ end
local default_probe_dir = get_probe_dir(vim.fn.getcwd())
+local bin_name = 'ngserver'
+local args = {
+ '--stdio',
+ '--tsProbeLocations',
+ default_probe_dir,
+ '--ngProbeLocations',
+ default_probe_dir,
+}
+
+local cmd = { bin_name, unpack(args) }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name, unpack(args) }
+end
+
return {
default_config = {
- cmd = {
- 'ngserver',
- '--stdio',
- '--tsProbeLocations',
- default_probe_dir,
- '--ngProbeLocations',
- default_probe_dir,
- },
+ cmd = cmd,
filetypes = { 'typescript', 'html', 'typescriptreact', 'typescript.tsx' },
-- Check for angular.json or .git first since that is the root of the project.
-- Don't check for tsconfig.json or package.json since there are multiple of these