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

AutoSuggest/IntelliSense shows templates where they are not applicable #17

Closed
httpdigest opened this issue Jun 14, 2016 · 4 comments
Closed

Comments

@httpdigest
Copy link

After installing these wonderful snippets, they are now being suggested almost everywhere (except when using the 'dot-into' operator on a type), such as when trying to list the properties of an object.
Where I noticed it was when "ctrl+space listing" the properties of the @Component metadata object.

What I concretely did was to use the ng2-controller template to create a new controller. Then, because I am new to AngularJS, I moved the keyboard cursor into the argument object of the @Component call to see what else (except for moduleId, selector and templateUrl) was available there. So I hit "ctrl+space" and was overwhelmed with the code templates also showing there, where I guess, they would not be valid.

@johnpapa
Copy link
Owner

we'd need to be able to apply context to do this level. @chrisdias may know if this is on the VS Code teams radar.

@chrisdias
Copy link

@aeschli @jrieken any ideas?

@jrieken
Copy link

jrieken commented Jan 24, 2017

We don't expose scopes/context that is derived from a TM grammar because of their varying qualities and because that would lead to feature that are tight coupled with one specific grammar.

For smarter snippets we recommend to implement a CompletionItemProvider which for instance can use a syntax tree to figure out what the best snippets for a certain position are. The drawback however is that those snippets are computed dynamically cannot be invoked from tab-completion (yet)

@johnpapa
Copy link
Owner

closing due to inactivity

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

4 participants