-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
.cabal
file STextDocument
errors?
#223
Comments
Hi. Thanks for the feedback. The error message How do you configure the haskell-tools plugin? The legacy With the recommended approach, you can register different client capabilities for haskell and cabal files, respectively. |
Hey Marc, appreciate the response. Knowing you're taking some time off, please don't feel compelled to respond right away! 😅
I do use
Here's how I configured {
"mrcjkb/haskell-tools.nvim",
ft = { "haskell" },
branch = "1.x.x", -- recommended by haskell-tools
init = function() astronvim.lsp.skip_setup = utils.list_insert_unique(astronvim.lsp.skip_setup, "hls") end,
opts = {
hls = {
on_attach = function(client, bufnr) require("astronvim.utils.lsp").on_attach(client, bufnr) end,
},
},
config = function(_, opts)
local tools = require "haskell-tools"
vim.api.nvim_create_autocmd("Filetype", {
pattern = "haskell", -- autocmd to start haskell-tools
callback = function() tools.start_or_attach(opts) end,
})
vim.api.nvim_create_autocmd("LspAttach", {
pattern = "*.hs", -- autocmd to start haskell-tools
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if client.name == "haskell-tools.nvim" then tools.dap.discover_configurations(args.buf) end
end,
})
end,
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim", -- optional
},
}, |
Ah, so it seems a little more general than I originally thought: while editing Dropping in the (I'm just chronicling observations here...I have very little (read: absolutely no) idea why this is happening.) |
🤔 it appears Try adding the following to your provider_selector = function(_bufnr, filetype, _buftype)
if filetype == 'cabal' then
return { 'treesitter', 'indent' }
end
return nil -- use default
end, That disables the lsp provider for cabal files. |
P.S. if this works for you, please leave this issue open. (Note to self: https://github.com/kevinhwang91/nvim-ufo/blob/43e39ec74cd57c45ca9d8229a796750f6083b850/lua/ufo/provider/lsp/nvim.lua#L53) |
This seems to prevent the first error, but unfortunately, no dice for the second error. 🙁 Dropping a screen cap here that shows current state of affairs: Definitely happy to continue to be the guinea pig here! Just let me know whatever you'd need from my end. Thanks! |
Ah, I didn't notice the second error. For example, you can disable this feature for cabal files in filetypes_denylist = {
'cabal',
'dirvish'
'fugitive',
}, I haven't encountered this error with vim-illuminate (and I don't have it disabled for cabal files) so it could be a different plugin causing it for you.
This might be a very useful observation, actually. |
@Per48edjes could you please test the It works for me, but I'd like to know if it's solved for you before merging. |
Oops, I forgot to add |
🥁 ... 🎉 ! No more cascading pop-ups and no error on load -- thank you, so much, for working on this, @mrcjkb ! |
😄 thanks for testing |
Fixes #223 ###### Things done - [x] Tested, as applicable: - [x] Manually - [ ] Added plenary specs - [x] Updated [CHANGELOG.md](https://github.com/MrcJkb/haskell-tools.nvim/blob/master/CHANGELOG.md) (if applicable). - [x] Fits [CONTRIBUTING.md](https://github.com/MrcJkb/haskell-tools.nvim/blob/master/CONTRIBUTING.md)
@all-contributors please add @Per48edjes for bug. |
I've put up a pull request to add @Per48edjes! 🎉 |
Adds @Per48edjes as a contributor for bug. This was requested by mrcjkb [in this comment](#223 (comment)) [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Co-authored-by: Marc Jakobi <marc@jakobi.dev>
Question
Love this plugin! Makes developing for a Haskell newbie like me so much easier -- thank you!
Because I'm still green, I'm wondering why I'm getting this error messages whenever I open a
.cabal
file in a buffer:...and this one whenever I navigate around the
.cabal
file (copied from:Notifications
):I did a little digging into
ghcide
, but it looks like it's been obviated by HLS?I'm tagging this as a
question
because I highly suspect this is "user error" (vs. a bug)...any guidance would be most helpful! (Happy to provide more detail as required.)Update: Sometimes these issues arise on
*.yaml
project files, other times they don't...? After awhile I think this error goes away (when either configuration filetype is open)? It's been difficult to pin down the behavior of this.The text was updated successfully, but these errors were encountered: