Skip to content

Add explicit "auto" quotePreference #29785

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
Feb 6, 2019

Conversation

minestarks
Copy link
Member

@minestarks minestarks commented Feb 6, 2019

Fixes #29762

Today, VS passes "" for UserPreferences.quotePreference to imply "infer from existing imports". This was causing an exception to be thrown from createCompletionEntry/quote when wrapping some properties in quotes.

This PR accomplishes two things

  • For older editors, handle "" more gracefully so the exception is avoided
  • Allow newer editors to be able to pass in an explicit auto option for this preference.

@jessetrinity wrote this.

FYI @mjbvz for VS Code

@RyanCavanaugh we'd like to take this into 3.3.2 as a fix for that exception.

@minestarks minestarks merged commit c03af51 into microsoft:master Feb 6, 2019
minestarks added a commit to minestarks/TypeScript that referenced this pull request Feb 6, 2019
…eference

Add explicit "auto" quotePreference
switch (preferences.quotePreference) {
case undefined:
switch (quotePreference) {
// TODO use getQuotePreference to infer the actual quote style.
Copy link
Member

Choose a reason for hiding this comment

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

Is this TODO tracked by a bug?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, it may be a good idea though

Copy link
Member

Choose a reason for hiding this comment

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

Probably tag the one above with the same ID.

@minestarks
Copy link
Member Author

Merged a bit prematurely, still testing, please feel free to keep reviewing

@amcasey
Copy link
Member

amcasey commented Feb 7, 2019

I would have guessed that this feature had reasonably good test coverage, so it should be straightforward to copy/modify one to cover auto.

@amcasey
Copy link
Member

amcasey commented Feb 7, 2019

Is VS going to start sending auto? I guess there's no reason to continue sending empty string (i.e. to old servers) if it caused exceptions.

@minestarks
Copy link
Member Author

@amcasey yes there will be a VS side change incoming to send auto, but probably a little bit later.

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

Successfully merging this pull request may close these issues.

Add editor support for inferred import completion
3 participants