Skip to content

Add restrictions to IsGlobalCompletion #11647

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

Merged
merged 2 commits into from
Oct 18, 2016

Conversation

jramsay
Copy link
Member

@jramsay jramsay commented Oct 14, 2016

JS/TS snippets are showing up in undesirable locations in VS
ex: import { | } from "./files1"

Restrict IsGlobalCompletion to:

  • SourceFile
  • Template Expression
  • Statements

- SourceFile
- Template Expression
- Statements
@jramsay
Copy link
Member Author

jramsay commented Oct 14, 2016

// cc: @mhegazy, @vladima , @billti

@billti
Copy link
Member

billti commented Oct 17, 2016

Looks good. 👍

What's the behavior on JSX elements and expressions? The tests only cover attributes? (Is this covered elsewhere?)

@DanielRosenwasser
Copy link
Member

Why TemplateExpression?

@jramsay
Copy link
Member Author

jramsay commented Oct 17, 2016

@DanielRosenwasser: the completion list for template expressions is the global completion list so thought it made sense to insert snippets here as well.

@DanielRosenwasser
Copy link
Member

@jramsay in the textual contents itself it makes sense to provide something like, let's say, an Angular template - but in those cases, you don't have a TemplateExpression, you have a NoSubstitutionTemplateLiteral. A TemplateExpression is a template string with embedded expression.

@jramsay
Copy link
Member Author

jramsay commented Oct 18, 2016

As per discussion with @DanielRosenwasser & @billti — keeping TemplateExpression and adding JsxExpression

@jramsay jramsay merged commit 14e5de3 into master Oct 18, 2016
@mhegazy mhegazy deleted the AddIsGlobalCompletionRestrictions branch November 2, 2017 21:03
@ghost ghost mentioned this pull request Jan 22, 2018
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants