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
suggestImportDisambiguation does not interact well with DuplicateRecordFields #1457
Comments
If you want to be really clever, in this situation you could suggest adding |
For the original issue, I just wondering if we have another file B.hs simultaneously: module B where
newtype RecC = RecC { foo :: Int }
What suggestions should ghcide gives? Maybe @adamgundry 's idea seems an appropriate solution, which can eliminate the worry above, but it may make the original function Meanwhile, we must notice that if we choose to keep the If we choose Our fix should consider these two situations. Please point out if I missed any other conditions. |
@berberman I am trying to fix this issue by just remove all ambiguities that are from the same module, does it make sense? |
@July541 Nice, what will it look like? Could you give an example? |
@berberman Here are two samples:
|
Looks great, thanks! |
@berberman Can you point me out where I can include some tests? I am not sure about how to integrate with a test. |
@July541 You could find related tests here: haskell-language-server/ghcide/test/exe/Main.hs Line 1592 in 3e3d782
|
Your environment
Output of
haskell-language-server --probe-tools
orhaskell-language-server-wrapper --probe-tools
:haskell-language-server version: 1.0.0.0 (GHC: 8.10.3) (PATH: /home/berberman/.cabal/store/ghc-8.10.3/haskell-language-server-1.0.0.0-c7859e8f45ef6bd2fac7adc65982f4e497ee3c40299bcc89c5915aaa0534ebc3/bin/haskell-language-server) Tool versions found on the $PATH cabal: 3.2.0.0 stack: Not found ghc: 8.10.3
Which lsp-client do you use:
vscode
Expected behaviour
There should be no suggestion, because the ambiguity comes from DuplicateRecordFields, rather than imports.
Actual behaviour
These code actions are meaningless in this case.
The text was updated successfully, but these errors were encountered: