mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
feat(extras): custum the path of packages
This commit is contained in:
parent
12818a6cb4
commit
1f5c005c03
6 changed files with 52 additions and 7 deletions
|
|
@ -1,3 +1,10 @@
|
||||||
|
if lazyvim_docs then
|
||||||
|
-- If you don't use Mason to install the `angular-language-server` you can use the following to custom path for `@angular/language-server`.
|
||||||
|
vim.g.pkg_path = {
|
||||||
|
["@angular/language-server"] = "path_to_this_node_package",
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
recommended = function()
|
recommended = function()
|
||||||
return LazyVim.extras.wants({
|
return LazyVim.extras.wants({
|
||||||
|
|
@ -51,7 +58,8 @@ return {
|
||||||
LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", {
|
LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", {
|
||||||
{
|
{
|
||||||
name = "@angular/language-server",
|
name = "@angular/language-server",
|
||||||
location = LazyVim.get_pkg_path("angular-language-server", "/node_modules/@angular/language-server"),
|
location = vim.g.pkg_path and vim.g.pkg_path["@angular/language-server"]
|
||||||
|
or LazyVim.get_pkg_path("angular-language-server", "/node_modules/@angular/language-server"),
|
||||||
enableForWorkspaceTypeScriptVersions = false,
|
enableForWorkspaceTypeScriptVersions = false,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
if lazyvim_docs then
|
||||||
|
-- If you don't use Mason to install the `astro-language-server` you can use the following to custom path for `@astrojs/ts-plugin`.
|
||||||
|
vim.g.pkg_path = {
|
||||||
|
["@astro/ts-plugin"] = "path_to_this_node_package",
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
recommended = function()
|
recommended = function()
|
||||||
return LazyVim.extras.wants({
|
return LazyVim.extras.wants({
|
||||||
|
|
@ -37,7 +44,8 @@ return {
|
||||||
LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", {
|
LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", {
|
||||||
{
|
{
|
||||||
name = "@astrojs/ts-plugin",
|
name = "@astrojs/ts-plugin",
|
||||||
location = LazyVim.get_pkg_path("astro-language-server", "/node_modules/@astrojs/ts-plugin"),
|
location = vim.g.pkg_path and vim.g.pkg_path["@astro/ts-plugin"]
|
||||||
|
or LazyVim.get_pkg_path("astro-language-server", "/node_modules/@astrojs/ts-plugin"),
|
||||||
enableForWorkspaceTypeScriptVersions = true,
|
enableForWorkspaceTypeScriptVersions = true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,10 @@ if lazyvim_docs then
|
||||||
vim.g.lazyvim_python_lsp = "pyright"
|
vim.g.lazyvim_python_lsp = "pyright"
|
||||||
-- Set to "ruff_lsp" to use the old LSP implementation version.
|
-- Set to "ruff_lsp" to use the old LSP implementation version.
|
||||||
vim.g.lazyvim_python_ruff = "ruff"
|
vim.g.lazyvim_python_ruff = "ruff"
|
||||||
|
-- If you don't use Mason to install the `debugpy` you can use the following to custom path for `debugpy`.
|
||||||
|
vim.g.pkg_path = {
|
||||||
|
["debugpy"] = "path_to_this_package",
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
local lsp = vim.g.lazyvim_python_lsp or "pyright"
|
local lsp = vim.g.lazyvim_python_lsp or "pyright"
|
||||||
|
|
@ -103,10 +107,11 @@ return {
|
||||||
{ "<leader>dPc", function() require('dap-python').test_class() end, desc = "Debug Class", ft = "python" },
|
{ "<leader>dPc", function() require('dap-python').test_class() end, desc = "Debug Class", ft = "python" },
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
|
local debugpy = vim.g.pkg_path and vim.g.pkg_path.debugpy
|
||||||
if vim.fn.has("win32") == 1 then
|
if vim.fn.has("win32") == 1 then
|
||||||
require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/Scripts/pythonw.exe"))
|
require("dap-python").setup(debugpy or LazyVim.get_pkg_path("debugpy", "/venv/Scripts/pythonw.exe"))
|
||||||
else
|
else
|
||||||
require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/bin/python"))
|
require("dap-python").setup(debugpy or LazyVim.get_pkg_path("debugpy", "/venv/bin/python"))
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
if lazyvim_docs then
|
||||||
|
-- If you don't use Mason to install the `svelte-language-server` you can use the following to custom path for `svelte-language-server`.
|
||||||
|
vim.g.pkg_path = {
|
||||||
|
["svelte-language-server"] = "path_to_this_node_package",
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
recommended = function()
|
recommended = function()
|
||||||
return LazyVim.extras.wants({
|
return LazyVim.extras.wants({
|
||||||
|
|
@ -48,7 +55,8 @@ return {
|
||||||
LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", {
|
LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", {
|
||||||
{
|
{
|
||||||
name = "typescript-svelte-plugin",
|
name = "typescript-svelte-plugin",
|
||||||
location = LazyVim.get_pkg_path("svelte-language-server", "/node_modules/typescript-svelte-plugin"),
|
location = vim.g.pkg_path and vim.g.pkg_path["typescript-svelte-plugin"]
|
||||||
|
or LazyVim.get_pkg_path("svelte-language-server", "/node_modules/typescript-svelte-plugin"),
|
||||||
enableForWorkspaceTypeScriptVersions = true,
|
enableForWorkspaceTypeScriptVersions = true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
if lazyvim_docs then
|
||||||
|
-- If you don't use Mason to install the `js-debug-adapter` you can use the following to custom path for `js-debug-adapter`.
|
||||||
|
vim.g.pkg_path = {
|
||||||
|
["js-debug-adapter"] = "path_to_this_node_package",
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
recommended = function()
|
recommended = function()
|
||||||
return LazyVim.extras.wants({
|
return LazyVim.extras.wants({
|
||||||
|
|
@ -200,7 +207,8 @@ return {
|
||||||
command = "node",
|
command = "node",
|
||||||
-- 💀 Make sure to update this path to point to your installation
|
-- 💀 Make sure to update this path to point to your installation
|
||||||
args = {
|
args = {
|
||||||
LazyVim.get_pkg_path("js-debug-adapter", "/js-debug/src/dapDebugServer.js"),
|
vim.g.pkg_path and vim.g.pkg_path["js-debug-adapter"]
|
||||||
|
or LazyVim.get_pkg_path("js-debug-adapter", "/js-debug/src/dapDebugServer.js"),
|
||||||
"${port}",
|
"${port}",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
if lazyvim_docs then
|
||||||
|
-- If you don't use Mason to install the `vue-language-server` you can use the following to custom path for `@vue/language-server`.
|
||||||
|
vim.g.pkg_path = {
|
||||||
|
["@vue/language-server"] = "path_to_this_node_package",
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
recommended = function()
|
recommended = function()
|
||||||
return LazyVim.extras.wants({
|
return LazyVim.extras.wants({
|
||||||
|
|
@ -39,7 +46,8 @@ return {
|
||||||
LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", {
|
LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", {
|
||||||
{
|
{
|
||||||
name = "@vue/typescript-plugin",
|
name = "@vue/typescript-plugin",
|
||||||
location = LazyVim.get_pkg_path("vue-language-server", "/node_modules/@vue/language-server"),
|
location = vim.g.pkg_path and vim.g.pkg_path["@vue/language-server"]
|
||||||
|
or LazyVim.get_pkg_path("vue-language-server", "/node_modules/@vue/language-server"),
|
||||||
languages = { "vue" },
|
languages = { "vue" },
|
||||||
configNamespace = "typescript",
|
configNamespace = "typescript",
|
||||||
enableForWorkspaceTypeScriptVersions = true,
|
enableForWorkspaceTypeScriptVersions = true,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue