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

Take a look at pkg/completion #103

Open
kevmoo opened this issue Nov 21, 2015 · 6 comments
Open

Take a look at pkg/completion #103

kevmoo opened this issue Nov 21, 2015 · 6 comments

Comments

@kevmoo
Copy link

kevmoo commented Nov 21, 2015

https://github.com/kevmoo/completion.dart

Manually writing completion scripts isn't a lot of fun – this just parties off pkg/args

Might be useful?

@evanweible-wf
Copy link
Contributor

@kevmoo hadn't seen that before, thanks for posting it! I'll look into using this

@georgelesica-wf
Copy link
Contributor

@kevmoo we're using completion.dart now (hooray!) We'd like to be able to provide a facility for doing something like below in a .bashrc or similar, but it doesn't appear to be possible.

source "$(pub global run dart_dev bash-completion)"

My intention was to just put the generated completion script in lib/ and then write the path to stdout. However, the Platform.script attribute is a URL when the app is run as a global, something like http://localhost:60270/dart_dev.dart, so we have no way of getting to lib/.

Another option would be to generate the script on the fly and use eval instead of source in the snippet above, but then we'd need to either install completions.dart globally and run it, or move most of the code in the completions.dart script into lib/ so the completions could be generated via Dart. I could do a quick PR to make that change, unless there's a workaround I'm not seeing...

@kevmoo
Copy link
Author

kevmoo commented May 4, 2016

@georgelesica-wf please file an issue on the completion package.

I'm guessing we have a way around this with recently added SDK APIs. Need to look into it.

@kevmoo
Copy link
Author

kevmoo commented May 4, 2016

@georgelesica-wf Actually, I'd say look at https://pub.dartlang.org/packages/package_config

This isn't anything to do with completion, I think. It's everything to do with getting to the lib dir from a globally activated package, right?

pkg/resource would be easier, but this only exposes the contents of the file – not the path.

@georgelesica-wf
Copy link
Contributor

@kevmoo Oh cool, actually the content would probably be fine because we could just use the eval ... pattern in our documentation instead of source .... I'll give it a try, thanks!

@kevmoo
Copy link
Author

kevmoo commented May 4, 2016

@georgelesica-wf I am doing work so you can 'pub global activate completion' too.

It has a silly dependency on Platform.script being a file: URI at the moment. I'm fixing that up.

@charliekump-wf charliekump-wf changed the title Take a look at pkg/completion CP-2130 Take a look at pkg/completion Jul 28, 2016
@maxwellpeterson-wf maxwellpeterson-wf changed the title CP-2130 Take a look at pkg/completion Take a look at pkg/completion Dec 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants