Remove obsolete CloudEnvironmentConnected_guid cloud-environment detection#84354
Open
Copilot wants to merge 3 commits into
Open
Remove obsolete CloudEnvironmentConnected_guid cloud-environment detection#84354Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
- Remove CloudEnvironmentConnected_guid check from LspEditorFeatureDetector.IsRemoteClient() in Razor - Update LspEditorFeatureDetectorTest.cs to remove cloud environment parameters and test cases - Remove IsCloudEnvironmentClient() from IWorkspaceContextService interface and DefaultWorkspaceContextService - Remove IsCloudEnvironmentClient() from VisualStudioWorkspaceContextService (was always dead code) - Remove IsCloudEnvironmentClient() call from VisualStudioRemoteHostClientProvider The UIContext to which CloudEnvironmentConnected_guid refers will never be activated per the platform's own obsolescence message, making all cloud-environment detection branches dead code. Co-authored-by: davidwengier <754264+davidwengier@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix obsolete VSConstants.UICONTEXT.CloudEnvironmentConnected_guid usage
Jul 1, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes cloud-environment detection based on the obsolete VSConstants.UICONTEXT.CloudEnvironmentConnected_guid across Roslyn’s Visual Studio and Razor integrations, simplifying remote/LSP-context checks and eliminating related warning suppressions.
Changes:
- Simplifies remote/LSP editor context detection by removing the obsolete cloud-environment UIContext checks.
- Removes
IsCloudEnvironmentClient()fromIWorkspaceContextServiceand its implementations/consumers. - Updates Razor unit tests to drop cloud-environment-specific test cases and parameters.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/VisualStudio/Core/Def/Remote/VisualStudioRemoteHostClientProvider.cs | Removes the cloud-environment guard that previously prevented OOP client startup. |
| src/VisualStudio/Core/Def/Implementation/VisualStudioWorkspaceContextService.cs | Simplifies IsInLspEditorContext() to exclude obsolete cloud-environment detection. |
| src/Razor/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.UnitTests/LspEditorFeatureDetectorTest.cs | Updates test data/setup to remove cloud-environment inputs and expectations. |
| src/Razor/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LspEditorFeatureDetector.cs | Simplifies IsRemoteClient() to only check Live Share guest UIContext. |
| src/EditorFeatures/Core/Shared/Utilities/IWorkspaceContextService.cs | Removes IsCloudEnvironmentClient() from the interface and default implementation. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
VSConstants.UICONTEXT.CloudEnvironmentConnected_guidis marked[Obsolete]with the message "The UIContext to which it refers will never be activated." All cloud-environment detection branches were therefore dead code and have been removed.Changes
LspEditorFeatureDetector.cs:IsRemoteClient()now only checks the LiveShare guest UIContext; theCloudEnvironmentConnected_guidcheck and its#pragma warning disable CS0618suppression are gone.LspEditorFeatureDetectorTest.cs: Removed thecloudEnvironmentConnectedActiveparameter from test data andCreateUIContextService. Test cases that were only true due to the cloud-environment path are dropped.IWorkspaceContextService.cs: RemovedIsCloudEnvironmentClient()from the interface and fromDefaultWorkspaceContextService(which already returnedfalse).VisualStudioWorkspaceContextService.cs: RemovedIsCloudEnvironmentClient()and its#pragma warning disable CS0618suppression;IsInLspEditorContext()simplified accordingly.VisualStudioRemoteHostClientProvider.cs: Removed theIsCloudEnvironmentClient()guard that suppressed OOP process startup — it was always a no-op.