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

[VS Code] Restrict modifying editor.suggestSelection for specific languages #71

Closed
KamasamaK opened this issue Mar 14, 2019 · 6 comments

Comments

@KamasamaK
Copy link

Product and Version: VS Code 1.32.2
OS Version: Windows 10
IntelliCode Extension Version: 1.1.4

Currently, the change to editor.suggestSelection is done globally even though IntelliCode for VS Code only supports 3 languages, which can individually be enabled. It would be preferable to only override this for the languages that are enabled by using language-specific editor settings.

@jkeech
Copy link
Collaborator

jkeech commented Mar 14, 2019

This is by design -- please see the discussion on #53 for context. There's not a perfect solution here, but the reason why we recently switched from language-specific settings to language-agnostic settings is so that a user's explicit language-agnostic setting still takes precedence. Most VS Code users don't know about the language-specific overrides, and the settings UI doesn't make it easy to see/change them, so if IntelliCode provides language-specific settings, most users do not see them or know how to override them.

You still have full control over the editor.suggestSelection setting -- you are free to use language-specific settings if it makes the most sense for your scenario. At runtime, IntelliCode checks whether you are using a compatible setting (no matter how you have it defined (global/workspace; language-agnostic/language-specific), and if so, it does not not attempt to change it.

@KamasamaK
Copy link
Author

Sorry, I didn't thoroughly think this through before posting. I see now that the API does not even allow setting language-specific configurations.

I do disagree with making this global change without asking/notifying just because it was left as the default. Also, the expectation according to comment 470332077 appears to be that to remedy this a user would use a language-specific setting even though, as you said, that is not well-known or easily discoverable.

@jkeech
Copy link
Collaborator

jkeech commented Mar 15, 2019

@KamasamaK, the behavior is as follows:

  1. If a user has a compatible setting for editor.suggestSelection, regardless of how it was selected, nothing happens
  2. If a user has explicitly picked a value for editor.suggestSelection which is incompatible with IntelliCode (currently, the only value that is incompatible is recentlyUsed), then IntelliCode will provide a toast notification explaining the issue and asking if they would like to change it. They can decline if they want, but the IntelliCode experience won't be as good.
  3. If the user has never made a selection for a specific setting of editor.suggestSelection, and they are getting the VS Code default value of recentlyUsed, then IntelliCode will automatically change the value to a better default for using IntelliCode. This case simplifies the setup and configuration for users who just want things to work out of the box without having to click through a bunch of prompts to get everything working.

Note that there is a difference between explicitly picking recentlyUsed in your settings json and happening to get it as the default value by not specifying a choice in the settings json. In the former case, we prompt the user to ask if they would like to change it. In the latter case, we automatically change the value (e.g. it's a different default when using IntelliCode).

I think this setup provides the best balance of simplifying configuration for the average user while still providing full control for advanced users.

If VS Code allowed packages to provide configuration defaults that did not override any explicit language-agnostic settings that user had previously set, we would prefer to go that route. But since it's not an option in VS Code today, we have to do this at runtime and change the setting value instead of just declaring defaults in our package.json.

@KamasamaK
Copy link
Author

This issue is primarily about scenario 3. It does simplify configuration for the average user by taking it out of their hands. This generally results in a better completion experience for them when using languages that IntelliCode supports, but a likely diminished completion experience for all other languages.

gewarren pushed a commit that referenced this issue Jun 25, 2019
@catycaldwell
Copy link
Contributor

@KamasamaK IntelliCode is not planning on taking on this suggestion, however, we thank you for your suggestion and feedback.

@KamasamaK
Copy link
Author

Thanks for considering this request. I will add that since the last time I commented here, the VS Code API was modified to now allow setting language-specific configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants