Skip to content

Remove obsolete CloudEnvironmentConnected_guid cloud-environment detection#84354

Open
Copilot wants to merge 3 commits into
mainfrom
copilot/revisit-obsolete-ui-context
Open

Remove obsolete CloudEnvironmentConnected_guid cloud-environment detection#84354
Copilot wants to merge 3 commits into
mainfrom
copilot/revisit-obsolete-ui-context

Conversation

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

VSConstants.UICONTEXT.CloudEnvironmentConnected_guid is 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; the CloudEnvironmentConnected_guid check and its #pragma warning disable CS0618 suppression are gone.
  • LspEditorFeatureDetectorTest.cs: Removed the cloudEnvironmentConnectedActive parameter from test data and CreateUIContextService. Test cases that were only true due to the cloud-environment path are dropped.
  • IWorkspaceContextService.cs: Removed IsCloudEnvironmentClient() from the interface and from DefaultWorkspaceContextService (which already returned false).
  • VisualStudioWorkspaceContextService.cs: Removed IsCloudEnvironmentClient() and its #pragma warning disable CS0618 suppression; IsInLspEditorContext() simplified accordingly.
  • VisualStudioRemoteHostClientProvider.cs: Removed the IsCloudEnvironmentClient() guard that suppressed OOP process startup — it was always a no-op.
- 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
Copilot AI requested a review from davidwengier July 1, 2026 11:42

@davidwengier davidwengier left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Makes sense to me

@davidwengier davidwengier marked this pull request as ready for review July 1, 2026 11:46
@davidwengier davidwengier requested review from a team as code owners July 1, 2026 11:46
Copilot AI review requested due to automatic review settings July 1, 2026 11:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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() from IWorkspaceContextService and 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.
Comment thread src/VisualStudio/Core/Def/Remote/VisualStudioRemoteHostClientProvider.cs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 2, 2026 00:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

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

3 participants