Add feature flag so we can remotely disable operator-completion.#52002
Add feature flag so we can remotely disable operator-completion.#52002CyrusNajmabadi merged 3 commits intodotnet:mainfrom
Conversation
| public const string LspTextSyncEnabled = "Roslyn.LspTextSyncEnabled"; | ||
| public const string RemoveUnusedReferences = "Roslyn.RemoveUnusedReferences"; | ||
| public const string LSPCompletion = "Roslyn.LSP.Completion"; | ||
| public const string UnnamedSymbolCompletionDisabled = "Roslyn.UnnamedSymbolCompletionDisabled"; |
There was a problem hiding this comment.
It's weird that this is a negative option shouldn't it be Roslyn.UnnamedSymbolCompletion whose default is true?
There was a problem hiding this comment.
it's a feature flag. we can't make a default for it. that would force us to have the experiment always running for all time, in order for this to work.
So this is the negative so we can say: by default, this runs. but an experiment can be enabled to turn it off. As opposed to: this is off, and we must always run an experiment forever to turn it on.
There was a problem hiding this comment.
We could add handling for this in VisualStudioExperimentationService for this but that does seem like overkill I suppose. We own all implementations of IExperimentationService so it's up to us to decide what an option being enabled means.
| // Escape hatch feature flag to let us disable this feature remotely if we run into any issues with it, | ||
| var workspace = document.Project.Solution.Workspace; | ||
| var experimentationService = workspace.Services.GetRequiredService<IExperimentationService>(); | ||
| var disabled = experimentationService.IsExperimentEnabled(WellKnownExperimentNames.UnnamedSymbolCompletionDisabled); |
There was a problem hiding this comment.
❗ This needs an option as well so it can be manually enabled via vsregedit. Here's an example from another feature:
roslyn/src/Workspaces/Remote/Core/RemoteHostOptions.cs
Lines 59 to 60 in 6da1274
No description provided.