hls-cabal-plugin should support completion for shorter file names
It'd be great if hls-cabal-plugin could complete shorter names if no ambiguity here, like ./src to src, including stanza
-
main-is -
hs-source-dirs -
extra-source-files
Hi, I would like to work on this issue.
The code in question is most likely in this function: https://github.com/haskell/haskell-language-server/blob/master/plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal/Completion/Completer/FilePath.hs#L77
This should be a matter of normalising the FilePath (or stripping away the leading ./).
We have a number of tests for this feature: https://github.com/haskell/haskell-language-server/blob/master/plugins/hls-cabal-plugin/test/Completer.hs#L167
You can run these tests in particular via an invocation like this:
> TASTY_PATTERN="Directory Completer Tests" cabal test hls-cabal-plugin-tests --test-show-details=direct
The tests need to be updated to reflect the new behaviour, e.g. completions @?== ["dir1/", "dir2/"]
Fixed by #4252