Skip to content

Set isNewIdentifierLocation to true for JavaScript files #10391

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
Aug 17, 2016

Conversation

jramsay
Copy link
Member

@jramsay jramsay commented Aug 17, 2016

Issue: Completion list auto-select is leading to a poor editing experience in JS files for Salsa
ex: var test = "test";
test.at auto-selects test.charAt

This is fine for TS where all completion items are high confidence. For JS, the completion lists will often contain low confidence items (identifiers in file) so auto-selecting is undesirable.

Fix: Always set isNewIdentifierLocation to true for JavaScript files. This ensures that for JS completions IsBuilder is true and auto-select is disabled.

@@ -4247,7 +4247,7 @@ namespace ts {
addRange(entries, keywordCompletions);
}

return { isMemberCompletion, isNewIdentifierLocation, entries };
return { isMemberCompletion, isNewIdentifierLocation: isSourceFileJavaScript(sourceFile) ? true : isNewIdentifierLocation, entries };
Copy link
Contributor

Choose a reason for hiding this comment

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

isNewIdentifierLocation || isSourceFileJavaScript(sourceFile)

@vladima
Copy link
Contributor

vladima commented Aug 17, 2016

👍 with a minor suggestion

@jramsay
Copy link
Member Author

jramsay commented Aug 17, 2016

Thanks - like the suggestion.

@jramsay jramsay merged commit 7a9f8c8 into master Aug 17, 2016
@jramsay jramsay deleted the SetIsNewIdentifierLocationToTrueForJS branch August 17, 2016 20:58
@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.

3 participants