Skip to content

Commit a96afbc

Browse files
committed
feat: JSON5 file extension support
1 parent c75393a commit a96afbc

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lua/lspsettings/loader.lua

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,16 @@ function JsonLoader:list_server_configs(server_name)
7979
local result = {}
8080
local paths = self.config.paths
8181
for _, path in ipairs(paths) do
82-
path = vim.fs.joinpath(path, server_name .. ".json")
83-
if vim.fn.filereadable(path) == 1 then
84-
table.insert(result, path)
82+
local path1 = vim.fs.joinpath(path, server_name .. ".json")
83+
if vim.fn.filereadable(path1) == 1 then
84+
table.insert(result, path1)
85+
end
86+
87+
if self.config.json5 then
88+
local path2 = vim.fs.joinpath(path, server_name .. ".json5")
89+
if vim.fn.filereadable(path2) == 1 then
90+
table.insert(result, path2)
91+
end
8592
end
8693
end
8794

0 commit comments

Comments
 (0)