vscode-haskell icon indicating copy to clipboard operation
vscode-haskell copied to clipboard

Code actions are duplicated 4x

Open andreasabel opened this issue 11 months ago • 4 comments

Screenshot 2024-12-09 at 15 55 02

Maybe nub before displaying?
How am I supposed to choose out of a list of 4 identical things? (Or, if they are not identical, why display them as identical?)

andreasabel avatar Dec 09 '24 14:12 andreasabel

This looks like the manifestation of https://github.com/haskell/haskell-language-server/issues/4461

Do you have instructions to reproduce this issue?

fendor avatar Dec 09 '24 15:12 fendor

This looks like the manifestation of haskell/haskell-language-server#4461

Yes looks similar enough.

Do you have instructions to reproduce these issue?

Mmh, no. Also because I clicked on "Ignore hint". Btw, what happens if I "Ignore hint"? I would have expected some .hlint.yaml file is created in the project root where I can then find my ignored hints. But there is no such file. Where do such settings go?

Are there log files that I could attach to this issue?

andreasabel avatar Dec 09 '24 15:12 andreasabel

Btw, what happens if I "Ignore hint"? I would have expected some .hlint.yaml file is created in the project root where I can then find my ignored hints. But there is no such file. Where do such settings go?

I think by default, hlint adds some pragma to the top of the file.

Are there log files that I could attach to this issue?

Not by default, no, you'd need to run your Language server with the log-file cli option.

fendor avatar Dec 09 '24 15:12 fendor

I think by default, hlint adds some pragma to the top of the file.

Ah, indeed, thanks.

andreasabel avatar Dec 09 '24 17:12 andreasabel

Same here. I don't have a reproducer, it does not seem to be deterministic. Sometimes all code actions are x2, sometimes x4. I understand that it would be great to fix the root cause, but frankly this is so annoying that I'd greatly appreciate someone just slapping nub (or nubOrd).

Bodigrim avatar Jul 06 '25 14:07 Bodigrim

@Bodigrim The issue is that it might be two language server instances running instead of one, often this happens when a file is opened that is not yet part of the project, for example via ctrl+n, then the editor sometimes infers Haskell, launches the HLS instance and suddenly there are two running.

Perhaps you can confirm this to be the reason for you?

fendor avatar Jul 06 '25 14:07 fendor

Ah, yes, this sounds likely. I’ll take a closer look when it happens to reproduce again.

Bodigrim avatar Jul 06 '25 14:07 Bodigrim