Skip to content
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

can't tab-complete to get filenames running stack exec for tools #832

Open
wolftune opened this issue Aug 23, 2015 · 6 comments
Open

can't tab-complete to get filenames running stack exec for tools #832

wolftune opened this issue Aug 23, 2015 · 6 comments

Comments

@wolftune
Copy link
Contributor

For example, if I use stack to install hlint, as in stack build hlint, then I must use stack to run it, and can't just do hlint on its own. It would be ideal to not always need stack exec hlint, but even if we accept that longer command, I can't tab-complete to get filenames then. So, this is far less ideal than pre-stack situation (but I want to stick to Stack generally, not go back to cabal install or system-level stuff for tools like this).

@borsboom borsboom added this to the Later improvements milestone Aug 23, 2015
@borsboom
Copy link
Contributor

You should be able to run stack install hlint, which will put hlint in ~/.local/bin (which you should add to your PATH). Then you can just use hlint normally, and this is the preferred way to set up such tools.

That said, tab completion for stack exec would be really nice. optparse-applicative has some support for custom completors, and it might be possible to use that to pass completion through to the command being execed, but I have no idea how difficult that would be. A pull request would be most welcome!

@wolftune
Copy link
Contributor Author

wolftune commented Sep 7, 2015

So, I discovered https://github.com/commercialhaskell/stack/wiki/Shell-autocompletion now… that's nice enough, though I think it just allows completion for stack arguments. Better than not having that, though it isn't what I wanted here really.

@Cypher1
Copy link

Cypher1 commented Jul 30, 2017

I'm having the same issue, #1343 seems to claim that this is working but I have only been able to autocomplete on options.

@mgsloan
Copy link
Contributor

mgsloan commented Aug 7, 2017

@Cypher1 It will only complete to executables specified in your project.

This is a tradeoff. Do we let the user complete to anything on the PATH (the one constructed when stack execing), or do we prioritize things from your project?

I'm thinking I might have gone the wrong way here, thinking it makes more sense to have it search the PATH, and not return any results from PATH when the prefix is empty. What do y'all think?

@Cypher1
Copy link

Cypher1 commented Aug 7, 2017

Thanks @mgsloan it seems that it was a stack 1.5 feature!

Can this be closed now?

@soulomoon
Copy link

Is that possible to complete filename after runghc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants