Open wedens opened 6 years ago
Solution is to use hsimport which we have patched to actually support this!
@fendor can you give quick explanation how?
Currently, we remove the line that contains the import here: https://github.com/haskell/haskell-ide-engine/blob/master/src/Haskell/Ide/Engine/Plugin/Generic.hs#L200
Which is just wrong, we have to modify the import line correctly. My idea would be to reuse our hsimport plugin which is responsible for offering import Code-Actions for symbols that it can find in the local hoogle db. Instead of importing, we want to hide a symbol now. hsimport offers an API to hide a symbol from an import and we could use that for hie.
What needs to be done
I think that we mostly have to change the generation of the code-actions, e.g. https://github.com/haskell/haskell-ide-engine/blob/master/src/Haskell/Ide/Engine/Plugin/HsImport.hs#L275 Also, the arguments to hsimport which are generated here: https://github.com/haskell/haskell-ide-engine/blob/master/src/Haskell/Ide/Engine/Plugin/HsImport.hs#L225
If there are more questions, just ask.
When I have an import string:
and
absfile
is unused, there is a suggestion to remove redundant import. When I apply the suggestion, it removes whole import string instead of justabsfile
. Tooltip correctly shows that onlyabsfile
is unused.Versions: haskell-ide-engine: 77ff1fa (HEAD at the moment) ghc: 8.4.3 vscode-hie-server: 0.0.24 stack: 1.7.1