fix(termux_language_server): fix lsp config

Fix the config for termux_language_server, allowing it to fully work
with all filetypes it actually supports
This commit is contained in:
Robert Morrison 2025-09-28 04:37:09 +01:00
parent cc99c75fe2
commit 986aa13d27
3 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,20 @@
---@type vim.lsp.Config
return {
cmd = { "termux-language-server" },
filetypes = {
"sh.build",
"sh.subpackage",
"sh.PKGBUILD",
"sh.install",
"sh.makepkg.conf",
"sh.ebuild",
"sh.eclass",
"sh.make.conf",
"sh.color.map",
"sh.mdd",
},
single_file_support = true,
}

View File

@ -3,8 +3,12 @@ local M = {}
M.setup = function() M.setup = function()
require("core.options") require("core.options")
require("core.autocommands") require("core.autocommands")
require("core.filetypes")
require("plugins.lazy") require("plugins.lazy")
-- Load this after loading plugins to ensure default lspconfig is there
require("core.lspconfig")
vim.cmd.colorscheme("gruvbox") vim.cmd.colorscheme("gruvbox")
end end

21
lua/core/lspconfig.lua Normal file
View File

@ -0,0 +1,21 @@
-- Manual lspconfig/changes where needed
vim.lsp.config("termux_language_server", {
filetypes = {
-- Android Termux
"sh.build", -- build.sh
"sh.subpackage", -- *.subpackage.sh
-- ArchLinux/Windows Msys2
"sh.PKGBUILD", -- PKGBUILD
"sh.install", -- *.install
"sh.makepkg.conf", -- makepkg.conf
-- Gentoo
"sh.ebuild", -- *.ebuild
"sh.eclass", -- *.eclass
"sh.make.conf", -- /etc/make.conf, /etc/portage/make.conf
"sh.color.map", -- /etc/portage/color.map
-- Zsh
"sh.mdd", -- *.mdd
},
})
vim.lsp.enable("termux_language_server") -- not enabled by default for some reason