-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: version 2.x.x ftplugin rewrite #226
Conversation
TODO:
|
00b942d
to
97e4755
Compare
local on_attach_def = function(client, bufnr)
local function buf_set_option(...)
vim.api.nvim_buf_set_option(bufnr, ...)
end
local buf_opts = { noremap = true, silent = true, buffer = bufnr }
-- buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
-- show info
vim.keymap.set("n", "K", vim.lsp.buf.hover, buf_opts)
-- open diagnostic window
vim.keymap.set("n", "<space>e", vim.diagnostic.open_float, buf_opts)
-- next error
vim.keymap.set("n", "<space>n", vim.diagnostic.goto_next, buf_opts)
-- prev error
vim.keymap.set("n", "<space>p", vim.diagnostic.goto_prev, buf_opts)
-- open code actions
-- vim.keymap.set("n", "<space>c", 'CodeActionMenu', buf_opts)
-- rename
vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, buf_opts)
-- goto references
vim.keymap.set("n", "gr", vim.lsp.buf.references, buf_opts)
-- goto definition
vim.keymap.set("n", "gd", vim.lsp.buf.definition, buf_opts)
-- format
vim.keymap.set("n", "<space>rf", function()
vim.lsp.buf.format({ async = true })
end, buf_opts)
vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, buf_opts)
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, buf_opts)
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, buf_opts)
vim.keymap.set("n", "<space>wa", vim.lsp.buf.add_workspace_folder, buf_opts)
vim.keymap.set("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, buf_opts)
vim.keymap.set("n", "<space>wl", function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, buf_opts)
vim.keymap.set("n", "<space>tl", lsplines.toggle, buf_opts)
end
local nvimlightbulb = require("nvim-lightbulb")
nvimlightbulb.setup({ autocmd = { enabled = true } })
-- Detect nvim-dap launch configurations
-- (requires nvim-dap and haskell-debug-adapter)
vim.g.haskell_tools = {
hls = {
on_attach = function(client, bufnr, ht)
local opts = { noremap = true, silent = true, buffer = bufnr }
ht.dap.discover_configurations(bufnr)
-- haskell-language-server relies heavily on codeLenses,
-- so auto-refresh (see advanced configuration) is enabled by default
vim.keymap.set("n", "<space>a", vim.lsp.codelens.run, opts)
-- Hoogle search for the type signature of the definition under the cursor
vim.keymap.set("n", "<space>hs", ht.hoogle.hoogle_signature, opts)
-- Evaluate all code snippets
vim.keymap.set("n", "<space>ea", ht.lsp.buf_eval_all, opts)
-- Toggle a GHCi repl for the current package
vim.keymap.set("n", "<leader>rt", ht.repl.toggle, opts)
-- Toggle a GHCi repl for the current buffer
vim.keymap.set("n", "<leader>rb", function()
ht.repl.toggle(vim.api.nvim_buf_get_name(0))
end, opts)
vim.keymap.set("n", "<leader>rq", ht.repl.quit, opts)
on_attach_def(client, bufnr)
end, I have tried to adjust my config to the new version of |
god, I have to rewrite my entire config, this is an absolute mess... |
Don't worry, you won't have to rewrite your entire config 😄 Can you send me a link to your config so I can identify the problem? |
yeah this was independent of haskell.nvim, my config looks like frankensteins monster at this point heh
|
It's nix, so I should be able to reproduce it. I'll give it a go after work 😅 |
@MangoIV I had a look at your config and couldn't see anything wrong with it. Maybe the call to Can you update the flake input and see if it works? |
Sure, will try and do that, thank you for investigating! |
nah, that wasn't it... I will try to diff carefully and see where I messed up >D |
Hmm, here are some things you can try:
|
This all seems fine, I think the issue is that |
nothing was getting called; I might have the solution and it might have been my stupid fault eh. |
nothing is getting called eh. |
That's very strange. I use Maybe somehow in your config, |
it's just the same thing as on my git, except it first calls the |
indeed; removing the |
I don’t know either tbh. Can’t imagine. |
Description of changes
This is a major (breaking) rewrite of haskell-tools.nvim.
See also: #227.
Things done