Skip to content

Commit

Permalink
extension/src/config.ts: handle the version with '-dev' as prerelease
Browse files Browse the repository at this point in the history
And change the version string in package.json on master to v0.44.0-dev
to indicate it is the dev version for v0.44.0.
Prerelease versions will use v0.43.X.

While doing so, I learned that the version string must have
Major.Minor.Patch[-prerelease] format, and strings like "v0.44-dev"
are not acceptable. Otherwise, `vsce` and vscode
test framework fails to build the extension quite mysteriously.

Change-Id: I6e73b2bf6d0f41b491844345193064320dd401e3
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/615775
Commit-Queue: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Hongxiang Jiang <hxjiang@golang.org>
kokoro-CI: kokoro <noreply+kokoro@google.com>
  • Loading branch information
hyangah committed Sep 25, 2024
1 parent cce5f07 commit 25448e0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).

## Unreleased

### Code Health

* Extension build target is set to `es2022`. ([Issue 3540](https://github.com/golang/vscode-go/issues/3540))
* The extension release workflow is migrated to the Go project's [Relui](https://pkg.go.dev/golang.org/x/build/cmd/relui#section-readme). ([Issue 3500](https://github.com/golang/vscode-go/issues/3500))

## v0.42.1

Date: 9 Sep, 2024
Expand Down
4 changes: 2 additions & 2 deletions extension/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion extension/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "go",
"displayName": "Go",
"version": "0.43.0-dev",
"version": "0.44.0-dev",
"publisher": "golang",
"description": "Rich Go language support for Visual Studio Code",
"author": {
Expand Down
7 changes: 5 additions & 2 deletions extension/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ export class ExtensionInfo {
this.version = version?.format();
this.appName = vscode.env.appName;

// golang.go prerelease: minor version is an odd number.
this.isPreview = !!(extensionId === 'golang.go' && version && version.minor % 2 === 1);
// golang.go prerelease: minor version is an odd number, or has the "-dev" suffix.
this.isPreview =
extensionId === 'golang.go' && !!version
? version.minor % 2 === 1 || version.toString().endsWith('-dev')
: false;
this.isInCloudIDE =
process.env.CLOUD_SHELL === 'true' ||
process.env.MONOSPACE_ENV === 'true' ||
Expand Down

0 comments on commit 25448e0

Please sign in to comment.