Skip to content

[Feat]: Add VS Code version number to --version output #4874

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

Closed
jawnsy opened this issue Feb 16, 2022 · 1 comment · Fixed by #4925
Closed

[Feat]: Add VS Code version number to --version output #4874

jawnsy opened this issue Feb 16, 2022 · 1 comment · Fixed by #4925
Assignees
Labels
enhancement Some improvement that isn't a feature
Milestone

Comments

@jawnsy
Copy link
Contributor

jawnsy commented Feb 16, 2022

What is your suggestion?

The code-server version output shows the version of code-server itself:

$ code-server --version
4.0.2 5cdfe74686aa73e023f8354a9a6014eb30caa7dd

It is possible to get the corresponding (embedded) VS Code/code-oss-dev version using the --json output:

$ code-server --version --json
{"codeServer":"4.0.2","commit":"5cdfe74686aa73e023f8354a9a6014eb30caa7dd","vscode":"1.63.0"}

It would be convenient to also have the VSCode version in the --version output.

Why do you want this feature?

This makes the VS Code version more discoverable, which is useful when evaluating the versions of extensions that are compatible.

Are there any workarounds to get this functionality today?

Yes, users can run code-server --version --json and look at the output. But JSON output is not as human-readable.

Are you interested in submitting a PR for this?

Sure, would like a pointer to the code though.

@jawnsy jawnsy added the enhancement Some improvement that isn't a feature label Feb 16, 2022
@jsjoeio jsjoeio added this to the On Deck - High Priority milestone Feb 16, 2022
@jsjoeio
Copy link
Contributor

jsjoeio commented Feb 16, 2022

Fantastic idea! This is where the code lives in entry.ts:

if (args.version) {
if (args.json) {
console.log(
JSON.stringify({
codeServer: version,
commit,
vscode: require("../../vendor/modules/code-oss-dev/package.json").version,
}),
)
} else {
console.log(version, commit)
}
return
}

I don't think we have a file yet called entry.test.ts so you could create one if you're comfortable adding a test as well (if not, I'm happy to).

Otherwise, you could add another test to our standalone release here:

https://github.com/coder/code-server/blob/94f378c1960a2b8df4da70fb900f6cfec0191982/ci/build/test-standalone-release.sh

jawnsy added a commit that referenced this issue Feb 26, 2022
Introduce helper functions for getting human- and machine-readable
version strings from the constants package, and cover it in unit
tests.

This is a first step to resolving #4874.
jawnsy added a commit that referenced this issue Feb 28, 2022
Introduce helper functions for getting human- and machine-readable
version strings from the constants package, and cover it in unit
tests.

This is a first step to resolving #4874.
jawnsy added a commit that referenced this issue Feb 28, 2022
Show the bundled version of Code OSS in the text-based output
for --version and --help, in addition to the JSON output
(--version --json)

Closes: #4874
@jsjoeio jsjoeio modified the milestones: March 2022, 4.0.3 Mar 1, 2022
jawnsy added a commit that referenced this issue Mar 1, 2022
Show the bundled version of Code OSS in the text-based output
for --version and --help, in addition to the JSON output
(--version --json)

Closes: #4874
TinLe pushed a commit to TinLe/code-server that referenced this issue Apr 23, 2022
Introduce helper functions for getting human- and machine-readable
version strings from the constants package, and cover it in unit
tests.

This is a first step to resolving coder#4874.
TinLe pushed a commit to TinLe/code-server that referenced this issue Apr 23, 2022
Show the bundled version of Code OSS in the text-based output
for --version and --help, in addition to the JSON output
(--version --json)

Closes: coder#4874
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Some improvement that isn't a feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants