move to backup

This commit is contained in:
Dennis 2026-03-03 10:46:08 +01:00
parent 294dc66380
commit a0e3d792a9
182 changed files with 156 additions and 103 deletions

View file

@ -0,0 +1,25 @@
local function get_typescript_server_path(root_dir)
local project_roots = vim.fs.find("node_modules", { path = root_dir, upward = true, limit = math.huge })
for _, project_root in ipairs(project_roots) do
local typescript_path = project_root .. "/typescript"
local stat = vim.loop.fs_stat(typescript_path)
if stat and stat.type == "directory" then
return typescript_path .. "/lib"
end
end
return ""
end
return {
cmd = { "astro-ls", "--stdio" },
filetypes = { "astro" },
root_markers = { "package.json", "tsconfig.json", "jsconfig.json", ".git" },
init_options = {
typescript = {},
},
before_init = function(_, config)
if config.init_options and config.init_options.typescript and not config.init_options.typescript.tsdk then
config.init_options.typescript.tsdk = get_typescript_server_path(config.root_dir)
end
end,
}