Skip to content

hls-cabal-plugin should support completion for shorter file names #3774

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

Closed
July541 opened this issue Aug 23, 2023 · 3 comments
Closed

hls-cabal-plugin should support completion for shorter file names #3774

July541 opened this issue Aug 23, 2023 · 3 comments
Assignees
Labels
component: hls-cabal-plugin Issues related to the hls-cabal-plugin type: enhancement New feature or request

Comments

@July541
Copy link
Collaborator

July541 commented Aug 23, 2023

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
@July541 July541 added type: enhancement New feature or request component: hls-cabal-plugin Issues related to the hls-cabal-plugin labels Aug 23, 2023
@VenInf
Copy link
Contributor

VenInf commented May 10, 2024

Hi, I would like to work on this issue.

@fendor
Copy link
Collaborator

fendor commented May 10, 2024

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/"]

VenInf added a commit to VenInf/haskell-language-server that referenced this issue May 26, 2024
fendor pushed a commit to VenInf/haskell-language-server that referenced this issue May 27, 2024
@fendor
Copy link
Collaborator

fendor commented Jul 15, 2024

Fixed by #4252

@fendor fendor closed this as completed Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: hls-cabal-plugin Issues related to the hls-cabal-plugin type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants