-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Minimal version deprecation change #252293
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
Open
igorkofman
wants to merge
12
commits into
microsoft:main
Choose a base branch
from
igorkofman:igor/minimal-version-deprecation-clean
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
8782859
Minimal version deprecation change
igorkofman b64335e
Revert MigrateDeprecatedExtensionAction.run() changes
igorkofman 736c4ef
Remove type annotation from deprecationInfo.settings.map
igorkofman 27a31f8
Remove extensionsWorkbenchService onChange listener
igorkofman da6df0a
Remove onChange listener while keeping extensionsWorkbenchService
igorkofman 4910aef
Minimize extensionsViewer.ts changes
igorkofman 30ca4d3
Remove extensionsWorkbenchService onChange listeners
igorkofman c16fafd
Remove unused extensionsWorkbenchService parameters
igorkofman 576f501
Simplify version deprecation check in unsupportedExtensionsMigration
igorkofman 3a82ad3
Undo comma delete
igorkofman ca743f5
Fix incorrect passing of isPreRelease flag
igorkofman 51e28d5
Merge branch 'main' into igor/minimal-version-deprecation-clean
igorkofman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
35 changes: 35 additions & 0 deletions
35
src/vs/workbench/contrib/extensions/common/extensionDeprecation.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { IExtension } from './extensions.js'; | ||
import * as semver from '../../../../base/common/semver/semver.js'; | ||
|
||
/** | ||
* This is the single source of truth for all deprecation UI decisions. | ||
* | ||
* Returns true only if: | ||
* 1. Extension has deprecation info, AND | ||
* 2. Current version is less than or equal to the deprecated version (or no version specified) | ||
*/ | ||
export function isExtensionDeprecated(extension: IExtension): boolean { | ||
if (!extension.deprecationInfo) { | ||
return false; | ||
} | ||
|
||
// If no deprecated version specified, treat as deprecated (backward compatibility) | ||
const deprecatedVersion = extension.deprecationInfo.deprecatedVersion; | ||
if (!deprecatedVersion) { | ||
return true; | ||
} | ||
|
||
// Get current version from local extension or gallery | ||
const currentVersion = extension.local?.manifest.version || extension.version; | ||
if (!currentVersion) { | ||
return true; // If we can't determine version, assume deprecated for safety | ||
} | ||
|
||
// Check if current version is less than or equal to deprecated version | ||
return semver.lte(currentVersion, deprecatedVersion); | ||
} |
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is potentially a bug in the existing implementation as it results in a "pre-release" badge on the extension. Ok skipping this but seems correct to include.