Skip to content
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

[CLI] Annotate prerelease extensions when list-extensions with show-versions #199894

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ const notFound = (id: string) => localize('notFound', "Extension '{0}' not found
const useId = localize('useId', "Make sure you use the full extension ID, including the publisher, e.g.: {0}", 'ms-dotnettools.csharp');


function getId(manifest: IExtensionManifest, withVersion?: boolean): string {
if (withVersion) {
function getId(manifest: IExtensionManifest, withVersion?: boolean, preRelease?: boolean): string {
if (withVersion && preRelease) {
return `${manifest.publisher}.${manifest.name}@${manifest.version}-prerelease`;
} else if (withVersion) {
return `${manifest.publisher}.${manifest.name}@${manifest.version}`;
} else {
return `${manifest.publisher}.${manifest.name}`;
Expand Down Expand Up @@ -74,7 +76,7 @@ export class ExtensionManagementCLI {
for (const extension of extensions) {
if (lastId !== extension.identifier.id) {
lastId = extension.identifier.id;
this.logger.info(getId(extension.manifest, showVersions));
this.logger.info(getId(extension.manifest, showVersions, extension.preRelease));
}
}
}
Expand Down