-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Separate global options and solution options #55728
Comments
@CyrusNajmabadi RFC |
I like this. I think this makes things more clear. My question is how options layer. There are some options that if not set at the solution level will default to whatever the user has set in visual studio (i.e. all editorconifg options). This seems to break this snap-shot friendly model. Should we also do as @sharwell suggests here and change this behavior so solution options do not depend on the current VS options? |
Yes, layering is something I'm looking into now. Document options vs. solution options vs. global options. Also some options should flow from TextView, but do not currently. |
Fine with this as a plan. today if someone changes and editorconfig file the file watcher fires and event, we read the new file contents, and finally fire a workspace event. If, in between all that, someone where to read options that came from that editorconfig file they would be out-of-date. I think this same model can be applied to VS options in some respects. If the user changes an option and that means the solution options have changed, then the client needs to push an update to the server. Until that happens things are out of date. |
Fallback is fine as long as the fallback target is also a snapshot. As an aside, any use of |
Agreed on both points. |
This is a good way to phrase it. We have a snapshot of the global vs options. once those change the VS client needs to push the changes to us and a new snapshot is created. anything operating off the old snapshot will have old options but that seems fine to me.
This is a good point @sharwell. It really should be |
More generally, any use of Workspace in feature implementations other than Workspace.Services in OOP is a conceptual error. |
Completed by #60888 |
Global options should only be accessed (get/set) via
IGlobalOptionService
. They are only available in-proc and in EditorFeatures layer and above. Global options should be used for client configuration (UI).Solution.Options
is obsolete. This property will remain for API compat and will only be populated with public options in-proc. It will be empty OOP. All currently used solution options are converted to global options.Workspace.Options
is obsolete and equivalent toWorkspace.CurrentSolution.Options
.IOptionProvider
andExportOptionProvider
are removed.Instead of reading solution-scoped options from
Solution.Options
remote services should receive them via a parameter. The parameter should be areadonly record struct XyzOptions
orrecord class XyzOptions
following pattern:Workspace or Features (server) layer:
EditorFeatures (client) layer:
This approach makes it clear which options the service depends on and potentially allows us to reuse the results when unrelated options change.
Option metadata/storage (
IOption
) is a client concept - it specifies where and how the option is stored. A feature implementation (server code) shouldn't concern itself with such information and thus should not refer toIOption
objects. Using the above pattern a feature implementation would operate onXyzOptions
type.XyzOptionsStorage
is client-only.TODO:
Related:
The text was updated successfully, but these errors were encountered: