Skip to content

Commit 171ef27

Browse files
committed
jetls-client: Prepare v0.2.0 release with migration support (#318)
Update jetls-client to v0.2.0 with enhanced update notification system that guides users through the breaking changes in JETLS installation method. Changes: - Update CHANGELOG.md with v0.2.0 release notes including breaking changes and installation steps - Implement three-tier notification system in checkForUpdates(): 1. First-time installation: Welcome message with 'Install JETLS' button that runs the new installation command 2. v0.1.x -> v0.2.0 upgrade: Warning message about breaking changes with 'Reinstall JETLS' button and link to migration guide (CHANGELOG.md#v020) 3. Normal updates: Standard update notification with 'Update JETLS' button - All notifications provide direct terminal commands or documentation links for easy user action The v0.2.0 release requires users to reinstall JETLS using the new `jetls` executable app method instead of the previous runserver.jl approach. The notification system ensures smooth migration for existing users while providing clear onboarding for new users.
1 parent ea8d05e commit 171ef27

File tree

2 files changed

+101
-11
lines changed

2 files changed

+101
-11
lines changed

jetls-client/CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
> [!note]
1111
>
1212
> - Commit: [`HEAD`](https://github.com/aviatesk/JETLS.jl/commit/HEAD)
13+
14+
## [v0.2.0]
15+
16+
[v0.2.0]: https://github.com/aviatesk/JETLS.jl/compare/b0a4a4c...HEAD
17+
18+
> [!note]
19+
>
1320
> - Diff: [`b0a4a4c...HEAD`](https://github.com/aviatesk/JETLS.jl/compare/b0a4a4c...HEAD)
1421
22+
> [!warning]
23+
> **Breaking changes**: JETLS installation method has changed significantly.
24+
> You must reinstall JETLS using the new `jetls` executable app.
25+
> See the [installation steps](#installation-steps) below.
26+
27+
### Installation steps
28+
29+
1. Install the `jetls` executable app:
30+
```bash
31+
julia -e 'using Pkg; Pkg.Apps.add("https://github.com/aviatesk/JETLS.jl#release")'
32+
```
33+
2. Make sure `~/.julia/bin` is in your `PATH`
34+
3. Restart VSCode
35+
1536
### Changed
1637

1738
- JETLS launch configuration has been significantly updated with the migration to the `jetls` executable app.

jetls-client/jetls-client.ts

Lines changed: 80 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ function createTimeoutHandler(
111111

112112
function getServerConfig(): ServerConfig {
113113
const config = vscode.workspace.getConfiguration("jetls-client");
114-
const defaultExecutable = process.platform === "win32" ? "jetls.exe" : "jetls";
114+
const defaultExecutable =
115+
process.platform === "win32" ? "jetls.exe" : "jetls";
115116
const executable = config.get<ExecutableConfig>("executable", {
116117
path: defaultExecutable,
117118
threads: "auto",
@@ -150,7 +151,8 @@ async function startLanguageServer() {
150151
baseCommand = cmd;
151152
baseArgs = args;
152153
} else {
153-
const defaultExecutable = process.platform === "win32" ? "jetls.exe" : "jetls";
154+
const defaultExecutable =
155+
process.platform === "win32" ? "jetls.exe" : "jetls";
154156
baseCommand = serverConfig.executable.path || defaultExecutable;
155157
const threads = serverConfig.executable.threads || "auto";
156158
baseArgs = [`--threads=${threads}`, "--"];
@@ -466,32 +468,99 @@ async function checkForUpdates(context: ExtensionContext): Promise<void> {
466468
?.packageJSON.version;
467469
const previousVersion = context.globalState.get<string>("version");
468470

469-
if (currentVersion && previousVersion && currentVersion !== previousVersion) {
471+
if (currentVersion && !previousVersion) {
472+
// First-time installation
470473
const message =
471-
"JETLS Client has been updated! Please make sure to update the JETLS server as well.";
472-
const updateButton = "Update JETLS";
473-
const docsButton = "View Changelog";
474+
"Welcome to JETLS Client! To use this extension, you need to install the JETLS executable. " +
475+
"Click 'Install JETLS' to get started.";
476+
const installButton = "Install JETLS";
477+
const docsButton = "View Installation Guide";
474478

475479
const selection = await vscode.window.showInformationMessage(
476480
message,
477-
updateButton,
481+
installButton,
478482
docsButton,
479483
);
480484

481-
if (selection === updateButton) {
482-
const terminal = vscode.window.createTerminal("Update JETLS");
485+
if (selection === installButton) {
486+
const terminal = vscode.window.createTerminal("Install JETLS");
483487
terminal.show();
484488
terminal.sendText(
485-
'julia -e \'using Pkg; Pkg.Apps.update("JETLS")\'',
489+
"julia -e 'using Pkg; Pkg.Apps.add(\"https://github.com/aviatesk/JETLS.jl#release\")'",
486490
true,
487491
);
488492
} else if (selection === docsButton) {
489493
vscode.env.openExternal(
490494
vscode.Uri.parse(
491-
"https://github.com/aviatesk/JETLS.jl/blob/master/CHANGELOG.md",
495+
"https://github.com/aviatesk/JETLS.jl/blob/master/jetls-client/README.md#getting-started",
492496
),
493497
);
494498
}
499+
} else if (
500+
currentVersion &&
501+
previousVersion &&
502+
currentVersion !== previousVersion
503+
) {
504+
// Update detected
505+
if (
506+
previousVersion.startsWith("0.1.") &&
507+
currentVersion.startsWith("0.2.")
508+
) {
509+
// Special handling for v0.1.x -> v0.2.0 breaking update
510+
const message =
511+
"JETLS Client v0.2.0 requires reinstalling JETLS with the new installation method. " +
512+
"Click 'Reinstall JETLS' to run the installation command.";
513+
const reinstallButton = "Reinstall JETLS";
514+
const migrationGuideButton = "View Migration Guide";
515+
516+
const selection = await vscode.window.showWarningMessage(
517+
message,
518+
reinstallButton,
519+
migrationGuideButton,
520+
);
521+
522+
if (selection === reinstallButton) {
523+
const terminal = vscode.window.createTerminal("Reinstall JETLS");
524+
terminal.show();
525+
terminal.sendText(
526+
"julia -e 'using Pkg; Pkg.Apps.add(\"https://github.com/aviatesk/JETLS.jl#release\")'",
527+
true,
528+
);
529+
} else if (selection === migrationGuideButton) {
530+
vscode.env.openExternal(
531+
vscode.Uri.parse(
532+
"https://github.com/aviatesk/JETLS.jl/blob/master/jetls-client/CHANGELOG.md#v020",
533+
),
534+
);
535+
}
536+
} else {
537+
// Normal update
538+
const message =
539+
"JETLS Client has been updated! Please make sure to update the JETLS server as well.";
540+
const updateButton = "Update JETLS";
541+
const changelogButton = "View Changelog";
542+
543+
const selection = await vscode.window.showInformationMessage(
544+
message,
545+
updateButton,
546+
changelogButton,
547+
);
548+
549+
if (selection === updateButton) {
550+
const terminal = vscode.window.createTerminal("Update JETLS");
551+
terminal.show();
552+
terminal.sendText(
553+
"julia -e 'using Pkg; Pkg.Apps.update(\"JETLS\")'",
554+
true,
555+
);
556+
} else if (selection === changelogButton) {
557+
vscode.env.openExternal(
558+
vscode.Uri.parse(
559+
"https://github.com/aviatesk/JETLS.jl/blob/master/jetls-client/CHANGELOG.md",
560+
),
561+
);
562+
}
563+
}
495564
}
496565

497566
if (currentVersion) {

0 commit comments

Comments
 (0)