Skip to content

Commit 5f1c9a9

Browse files
authored
fix(ts_ls): server not starting if there is no typescript #4011
1 parent a6bf2d1 commit 5f1c9a9

File tree

3 files changed

+0
-42
lines changed

3 files changed

+0
-42
lines changed

lsp/ts_ls.lua

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,6 @@ return {
6464
return
6565
end
6666

67-
-- We know that the buffer is using Typescript if it has a config file
68-
-- in its directory tree.
69-
local ts_config_files = { 'tsconfig.json', 'jsconfig.json' }
70-
local is_buffer_using_typescript = vim.fs.find(ts_config_files, {
71-
path = vim.api.nvim_buf_get_name(bufnr),
72-
type = 'file',
73-
limit = 1,
74-
upward = true,
75-
stop = vim.fs.dirname(project_root),
76-
})[1]
77-
if not is_buffer_using_typescript then
78-
return
79-
end
80-
8167
on_dir(project_root)
8268
end,
8369
handlers = {

lsp/tsgo.lua

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,6 @@ return {
3535
return
3636
end
3737

38-
-- We know that the buffer is using Typescript if it has a config file
39-
-- in its directory tree.
40-
local ts_config_files = { 'tsconfig.json', 'jsconfig.json' }
41-
local is_buffer_using_typescript = vim.fs.find(ts_config_files, {
42-
path = vim.api.nvim_buf_get_name(bufnr),
43-
type = 'file',
44-
limit = 1,
45-
upward = true,
46-
stop = vim.fs.dirname(project_root),
47-
})[1]
48-
if not is_buffer_using_typescript then
49-
return
50-
end
51-
5238
on_dir(project_root)
5339
end,
5440
}

lsp/vtsls.lua

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,6 @@ return {
8787
return
8888
end
8989

90-
-- We know that the buffer is using Typescript if it has a config file
91-
-- in its directory tree.
92-
local ts_config_files = { 'tsconfig.json', 'jsconfig.json' }
93-
local is_buffer_using_typescript = vim.fs.find(ts_config_files, {
94-
path = vim.api.nvim_buf_get_name(bufnr),
95-
type = 'file',
96-
limit = 1,
97-
upward = true,
98-
stop = vim.fs.dirname(project_root),
99-
})[1]
100-
if not is_buffer_using_typescript then
101-
return
102-
end
103-
10490
on_dir(project_root)
10591
end,
10692
}

0 commit comments

Comments
 (0)