hls etc.
This commit is contained in:
@@ -15,7 +15,6 @@
|
|||||||
"lazyvim.plugins.extras.editor.snacks_picker",
|
"lazyvim.plugins.extras.editor.snacks_picker",
|
||||||
"lazyvim.plugins.extras.editor.telescope",
|
"lazyvim.plugins.extras.editor.telescope",
|
||||||
"lazyvim.plugins.extras.formatting.prettier",
|
"lazyvim.plugins.extras.formatting.prettier",
|
||||||
"lazyvim.plugins.extras.lang.haskell",
|
|
||||||
"lazyvim.plugins.extras.lang.json",
|
"lazyvim.plugins.extras.lang.json",
|
||||||
"lazyvim.plugins.extras.lang.markdown",
|
"lazyvim.plugins.extras.lang.markdown",
|
||||||
"lazyvim.plugins.extras.lang.nix",
|
"lazyvim.plugins.extras.lang.nix",
|
||||||
|
@@ -1,40 +1,32 @@
|
|||||||
return {
|
return {
|
||||||
|
{
|
||||||
"mrcjkb/haskell-tools.nvim",
|
"mrcjkb/haskell-tools.nvim",
|
||||||
ft = { "haskell", "lhaskell", "cabal" },
|
-- WICHTIG: expliziter Modulname; Lazy soll NICHT raten
|
||||||
dependencies = { "L3MON4D3/LuaSnip", "nvim-treesitter/nvim-treesitter" },
|
main = "haskell-tools",
|
||||||
opts = {
|
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
|
||||||
|
|
||||||
|
-- Gib Lazy NICHT die Chance, sein Auto-setup zu machen:
|
||||||
|
-- Wir liefern EINE eigene config-Funktion und rufen setup() selbst.
|
||||||
|
config = function(_, _)
|
||||||
|
local ok, ht = pcall(require, "haskell-tools")
|
||||||
|
if not ok or type(ht.setup) ~= "function" then
|
||||||
|
vim.notify("[haskell-tools] setup() nicht gefunden – wird übersprungen", vim.log.levels.ERROR)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
ht.setup({
|
||||||
hls = {
|
hls = {
|
||||||
|
-- Dein Nix-HLS, damit Mason außen vor bleibt
|
||||||
cmd = { "haskell-language-server-wrapper", "--lsp" },
|
cmd = { "haskell-language-server-wrapper", "--lsp" },
|
||||||
settings = {
|
settings = {
|
||||||
haskell = {
|
haskell = {
|
||||||
formattingProvider = "fourmolu",
|
formattingProvider = "fourmolu",
|
||||||
-- wir nutzen das interne Plugin, kein externes Binary nötig:
|
|
||||||
plugin = { fourmolu = { config = { external = false } } },
|
|
||||||
|
|
||||||
-- .cabal-Formatting komplett deaktivieren (sonst verlangt HLS cabal-fmt)
|
|
||||||
cabalFormattingProvider = "none",
|
cabalFormattingProvider = "none",
|
||||||
|
plugin = { fourmolu = { config = { external = false } } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- optional: Safety im on_attach
|
})
|
||||||
on_attach = function(client, bufnr)
|
|
||||||
if vim.bo[bufnr].filetype == "cabal" then
|
|
||||||
client.server_capabilities.documentFormattingProvider = false
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
-- falls Lazy mal falsch cached: lade LuaSnip aktiv vorher
|
|
||||||
init = function()
|
|
||||||
if not package.loaded["luasnip"] then
|
|
||||||
local ok, lazy = pcall(require, "lazy")
|
|
||||||
if ok then
|
|
||||||
lazy.load({ plugins = { "LuaSnip" } })
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
-- lade nur, wenn require("luasnip") wirklich klappt
|
|
||||||
cond = function()
|
|
||||||
return package.loaded["luasnip"] or pcall(require, "luasnip")
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@@ -2,10 +2,12 @@ return {
|
|||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
version = false,
|
version = false,
|
||||||
lazy = false, -- <- wichtig: vor FileType-Kram geladen
|
|
||||||
priority = 1000, -- <- noch davor
|
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
main = "nvim-treesiter.configs",
|
|
||||||
|
-- Lazy ruft automatisch: require(main).setup(opts)
|
||||||
|
-- => Wir brauchen KEIN require('nvim-treesitter.configs') mehr.
|
||||||
|
main = "nvim-treesitter.configs",
|
||||||
|
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
opts.ensure_installed = vim.tbl_extend("force", opts.ensure_installed or {}, {
|
opts.ensure_installed = vim.tbl_extend("force", opts.ensure_installed or {}, {
|
||||||
@@ -23,5 +25,20 @@ return {
|
|||||||
opts.highlight.enable = true
|
opts.highlight.enable = true
|
||||||
return opts
|
return opts
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
-- Nur der Shim; KEIN require('nvim-treesitter.configs') hier!
|
||||||
|
config = function()
|
||||||
|
local ok, parsers = pcall(require, "nvim-treesitter.parsers")
|
||||||
|
if ok and parsers and parsers.ft_to_lang == nil then
|
||||||
|
local langmod = vim.treesitter.language
|
||||||
|
if langmod and type(langmod.get_lang) == "function" then
|
||||||
|
parsers.ft_to_lang = function(ft)
|
||||||
|
return langmod.get_lang(ft) or ft
|
||||||
|
end
|
||||||
|
elseif type(parsers.filetype_to_parsername) == "function" then
|
||||||
|
parsers.ft_to_lang = parsers.filetype_to_parsername
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user