Skip to content

Separate isGlobalCompletion from CompletionKind #22074

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
2 commits merged into from
Feb 21, 2018
Merged

Separate isGlobalCompletion from CompletionKind #22074

2 commits merged into from
Feb 21, 2018

Conversation

ghost
Copy link

@ghost ghost commented Feb 20, 2018

Sequel to #21973 -- since we can have isGlobalCompletion === false for global completions, give it a different name isInSnippetScope and make unrelated to CompletionKind.
May also fix #21790 due to not returning needsConvertPropertyAccess: true on CompletionKind.None.

@ghost ghost requested review from sheetalkamat and armanio123 February 20, 2018 22:59
@@ -753,6 +754,7 @@ namespace ts.Completions {
log("getCompletionData: Is inside comment: " + (timestamp() - start));

let insideJsDocTagTypeExpression = false;
let isInSnippetScope = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not this default to true then? it used to default to Global before. we do not want to change the behavior really since we have no test coverage here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is correct -- we only assigned completionKind = CompletionKind.Global; in one place before, and that location is now the only assignment to isInSnippetScope.

@ghost ghost merged commit 4f30970 into master Feb 21, 2018
@ghost ghost deleted the isInSnippetScope branch February 21, 2018 21:12
@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
This pull request was closed.
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.

TypeError: Cannot read property 'getChildren' of undefined in 'Object.findChildOfKind' during 'completions'
1 participant