diff options
Diffstat (limited to 'lua/lspconfig/tsserver.lua')
| -rw-r--r-- | lua/lspconfig/tsserver.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lua/lspconfig/tsserver.lua b/lua/lspconfig/tsserver.lua index d95e7d54..a3a78a71 100644 --- a/lua/lspconfig/tsserver.lua +++ b/lua/lspconfig/tsserver.lua @@ -11,7 +11,10 @@ configs[server_name] = { default_config = { cmd = {bin_name, "--stdio"}; filetypes = {"javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx"}; - root_dir = util.root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git"); + root_dir = function(fname) + return util.root_pattern("tsconfig.json")(fname) or + util.root_pattern("package.json", "jsconfig.json", ".git")(fname); + end }; docs = { description = [[ |
