Skip to content

Commit 8610c34

Browse files
authored
Simplify walkthrough steps (#833)
1 parent 52af240 commit 8610c34

File tree

20 files changed

+595
-113
lines changed

20 files changed

+595
-113
lines changed

package-lock.json

Lines changed: 20 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 39 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -64,112 +64,62 @@
6464
"walkthroughs": [
6565
{
6666
"id": "javaWelcome",
67-
"title": "Dive into Java Development",
68-
"description": "Your first steps to set up powerful Java tools in a lightweight, performant editor!",
67+
"title": "%walkthrough.title%",
68+
"description": "%walkthrough.description%",
6969
"steps": [
7070
{
7171
"id": "java.runtime",
72-
"title": "Get your Java runtime ready",
73-
"description": "The built-in configurator makes it easy to set up your preferred Java runtime.\n[Configure Java Runtime](command:toSide:java.runtime)",
72+
"title": "Get your runtime ready",
73+
"description": "%walkthrough.java.runtime%",
7474
"media": {
75-
"image": "walkthrough/runtime.png",
76-
"altText": "Configure Java Runtime with tabs for Project SDKs"
75+
"markdown": "walkthrough/runtime.md"
7776
}
7877
},
79-
{
80-
"id": "java.extGuide",
81-
"title": "Support additional tools and frameworks",
82-
"description": "Got additional support for major tool chains, frameworks and application servers.\n[Recommended Java Extensions](command:toSide:java.extGuide)",
83-
"media": {
84-
"image": "walkthrough/extGuide.png",
85-
"altText": "Open Project Folder"
86-
}
87-
},
88-
{
89-
"id": "java.openProjectFolder",
90-
"title": "Open project folder",
91-
"description": "Open an existing folder that contains your Java project, or create a new folder.\n[Open Folder...](command:workbench.action.files.openFolder)\n[Create New Project...](command:java.project.create)",
92-
"media": {
93-
"image": "walkthrough/open-project.png",
94-
"altText": "Open Project Folder"
95-
},
96-
"when": "!isMac && workspaceFolderCount == 0"
97-
},
98-
{
99-
"id": "java.openProjectFolder.mac",
100-
"title": "Open project folder",
101-
"description": "Open an existing folder that contains your Java project, or create a new folder.\n[Open Folder...](command:workbench.action.files.openFileFolder)\n[Create New Project...](command:java.project.create)",
102-
"media": {
103-
"image": "walkthrough/open-project.png",
104-
"altText": "Open Project Folder"
105-
},
106-
"when": "isMac && workspaceFolderCount == 0"
107-
},
10878
{
10979
"id": "java.showProjectExplorer",
110-
"title": "Explore your project",
111-
"description": "View classpaths and dependencies, and create new projects, packages and classes.\n[Show Java Projects](command:javaProjectExplorer.focus)",
80+
"title": "Explore your projects",
81+
"description": "%walkthrough.java.projects%",
11282
"media": {
113-
"image": "walkthrough/project-manager.png",
83+
"svg": "walkthrough/projects.svg",
11484
"altText": "Project Explorer"
11585
},
116-
"when": "java:projectManagerActivated"
86+
"when": "java:projectManagerActivated && workspaceFolderCount > 0"
11787
},
11888
{
119-
"id": "java.showProjectExplorer.notActivated",
89+
"id": "java.showProjectExplorer.inactive",
12090
"title": "Explore your project",
121-
"description": "View classpaths and dependencies, and create new projects, packages and classes.",
91+
"description": "%walkthrough.java.projects.inactive%",
12292
"media": {
123-
"image": "walkthrough/project-manager.png",
93+
"svg": "walkthrough/projects.svg",
12494
"altText": "Project Explorer"
12595
},
126-
"when": "!java:projectManagerActivated"
96+
"when": "!java:projectManagerActivated || workspaceFolderCount == 0"
12797
},
12898
{
129-
"id": "java.showDebugView",
130-
"title": "Launch and debug your app",
131-
"description": "The debugger will automatically find the entry point of your project, launch it and start debugging.\n[Show Run and Debug View](command:workbench.view.debug)\n[Learn More...](https://code.visualstudio.com/docs/java/java-debugging)",
99+
"id": "java.debugAndTest",
100+
"title": "Launch, debug and test",
101+
"description": "%walkthrough.java.debugAndTest%",
132102
"media": {
133-
"image": "walkthrough/debugger.png",
134-
"altText": "Running and Debugging"
103+
"svg": "walkthrough/debugAndTest.svg",
104+
"altText": "Launch, debug and test"
135105
}
136106
},
137107
{
138-
"id": "java.showTesting",
139-
"title": "Run and debug tests",
140-
"description": "The place to show all the test cases in your project. You can also run/debug your test cases from here.\n[Show Testing View](command:testExplorer.focus)",
141-
"media": {
142-
"image": "walkthrough/testing.png",
143-
"altText": "Testing"
144-
},
145-
"when": "java:testRunnerActivated"
146-
},
147-
{
148-
"id": "java.showTesting.notActivated",
149-
"title": "Run and debug tests",
150-
"description": "The place to show all the test cases in your project. You can also run/debug your test cases from here.",
151-
"media": {
152-
"image": "walkthrough/testing.png",
153-
"altText": "Testing"
154-
},
155-
"when": "!java:testRunnerActivated"
156-
},
157-
{
158-
"id": "java.tutorial",
159-
"title": "Quick start with Java",
160-
"description": "Just starting with Java? Get hands on with these tutorials to learn the fundamentals of Java editing & debugging.\n[Open Tutorials](command:toSide:java.gettingStarted)",
108+
"id": "java.extensions",
109+
"title": "Extensions for additional tools and frameworks",
110+
"description": "%walkthrough.java.extensions%",
161111
"media": {
162-
"image": "walkthrough/tutorials.png",
163-
"altText": "Tutorials"
112+
"svg": "walkthrough/extensions.svg",
113+
"altText": "Extensions"
164114
}
165115
},
166116
{
167-
"id": "java.showHelpCenter",
168-
"title": "Java Help Center",
169-
"description": "Discover more shortcuts and features on this page.\n[Open Java Help Center](command:toSide:java.welcome.fromWalkthrough)",
117+
"id": "java.more",
118+
"title": "Explore more Java resources",
119+
"description": "%walkthrough.java.more%",
170120
"media": {
171-
"image": "walkthrough/help-center.png",
172-
"altText": "Java Help Center"
121+
"svg": "walkthrough/ok.svg",
122+
"altText": "Explore more Java resources"
173123
}
174124
}
175125
]
@@ -181,15 +131,20 @@
181131
"category": "Java",
182132
"title": "Install New JDK"
183133
},
134+
{
135+
"command": "java.installJdk.fromWalkthrough",
136+
"category": "Java",
137+
"title": "Install New JDK"
138+
},
184139
{
185140
"command": "java.welcome",
186141
"category": "Java",
187-
"title": "Help Center (Welcome)"
142+
"title": "Help Center"
188143
},
189144
{
190145
"command": "java.welcome.fromWalkthrough",
191146
"category": "Java",
192-
"title": "Help Center (Welcome)"
147+
"title": "Help Center"
193148
},
194149
{
195150
"command": "java.classpathConfiguration",
@@ -275,6 +230,10 @@
275230
{
276231
"command": "java.welcome.fromWalkthrough",
277232
"when": "false"
233+
},
234+
{
235+
"command": "java.installJdk.fromWalkthrough",
236+
"when": "false"
278237
}
279238
],
280239
"view/title": [

package.nls.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"walkthrough.title": "Get Started with Java Development",
3+
"walkthrough.description": "Your first steps to set up powerful Java tools in a lightweight, performant editor!",
4+
"walkthrough.java.runtime": "The Extension Pack for Java requires at least one Java runtime to be installed.\n[Install JDK](command:toSide:java.installJdk.fromWalkthrough)",
5+
6+
"walkthrough.java.projects": "Java Project Explorer helps you to manage your projects and dependencies. It also helps you to create new Java project, classes and packages. \n[View Java Projects](command:javaProjectExplorer.focus)",
7+
8+
"walkthrough.java.projects.inactive": "Java Project Explorer helps you to manage your projects and dependencies. Create a new project or open an existing folder to see the full features.\n[Open Command Palette](command:workbench.action.quickOpen?%22>java%22)\n__Try searching for 'Create Java Project' or 'Open Folder'__",
9+
10+
"walkthrough.java.debugAndTest":"Run and debug your application using the debugger. [Learn More...](https://aka.ms/java-walkthrough-debug)\nThe [Testing Explorer](command:testExplorer.focus) allows you to view, run and manage all test cases in your project. [Learn More...](https://aka.ms/java-walkthrough-test)\n[Show Run and Debug View](command:workbench.view.debug)",
11+
12+
"walkthrough.java.extensions": "Install extensions to support additional frameworks such as Spring Boot, Application Servers, key mappings and so on.\n[Browse Recommended Extensions](command:toSide:java.extGuide)",
13+
14+
"walkthrough.java.more": "- 🎉 If you want to run your project with a specific runtime, you can [Configure Java Runtime](command:toSide:java.runtime).\n\n- 🎉 Visit [Dev Blogs](https://aka.ms/java-walkthrough-devblogs) to keep up-to-date with our latest product updates and announcements.\n\n- ✨ Discover more shortcuts and features in [Help Center](command:toSide:java.welcome.fromWalkthrough) or check documentation for tips and troubleshooting.\n\n- ✨ Report issues and feedback at our [Github repository](https://aka.ms/java-walkthrough-issue)."
15+
}

src/commands/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
33

4-
import { installJDKCmdHandler } from "../install-jdk";
4+
import { showInstallJdkWebview, showInstallJdkWebviewBeside } from "../install-jdk";
55
import * as vscode from "vscode";
66
import { instrumentOperation, instrumentOperationAsVsCodeCommand } from "vscode-extension-telemetry-wrapper";
77
import { showClasspathConfigurationPage } from "../classpath/classpathConfigurationView";
@@ -33,7 +33,8 @@ export function initialize(context: vscode.ExtensionContext) {
3333
context.subscriptions.push(instrumentOperationAsVsCodeCommand("java.formatterSettings", javaFormatterSettingsEditorProvider.showFormatterSettingsEditor, javaFormatterSettingsEditorProvider));
3434
context.subscriptions.push(instrumentOperationAsVsCodeCommand("java.formatterSettings.showTextEditor", javaFormatterSettingsEditorProvider.reopenWithTextEditor));
3535
registerCommandHandler(context, "java.classpathConfiguration", showClasspathConfigurationPage);
36-
registerCommandHandler(context, "java.installJdk", installJDKCmdHandler);
36+
registerCommandHandler(context, "java.installJdk", showInstallJdkWebviewBeside);
37+
registerCommandHandler(context, "java.installJdk.fromWalkthrough", showInstallJdkWebview);
3738
}
3839

3940
type CommandHandler = (context: vscode.ExtensionContext, operationId: string, ...args: any[]) => any;

src/install-jdk/index.ts

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,20 @@ import { availableReleases, latestCompatibleAsset } from '../utils/adoptiumApi';
88
import { WEBVIEW_ID } from './constants';
99

1010

11-
export function installJDKCmdHandler(context: vscode.ExtensionContext, _operationId?: string) {
11+
export function showInstallJdkWebview(context: vscode.ExtensionContext, _operationId?: string) {
1212
InstallJdkPage.createOrShow(context.extensionPath);
1313
}
1414

15+
export function showInstallJdkWebviewBeside(context: vscode.ExtensionContext, _operationId?: string) {
16+
InstallJdkPage.createOrShow(context.extensionPath, {
17+
beside: true
18+
});
19+
}
20+
1521
export class InstallJdkViewSerializer implements vscode.WebviewPanelSerializer {
1622
constructor(private context: vscode.ExtensionContext) { }
1723
async deserializeWebviewPanel(webviewPanel: vscode.WebviewPanel, _state: unknown) {
18-
InstallJdkPage.createOrShow(this.context.extensionPath, webviewPanel);
24+
InstallJdkPage.createOrShow(this.context.extensionPath, {webviewPanel});
1925
}
2026

2127
}
@@ -27,18 +33,25 @@ class InstallJdkPage {
2733
private readonly _extensionPath: string;
2834
private _disposables: vscode.Disposable[] = [];
2935

30-
public static createOrShow(extensionPath: string, webviewPanel?: vscode.WebviewPanel) {
31-
// "smart" Beside
32-
const ate = vscode.window.activeTextEditor;
33-
const column = (ate === undefined || ate.viewColumn === vscode.ViewColumn.One) ?
34-
vscode.ViewColumn.Two :
35-
vscode.ViewColumn.One;
36+
public static createOrShow(extensionPath: string, options?: {
37+
webviewPanel?: vscode.WebviewPanel;
38+
beside?: boolean;
39+
}) {
40+
41+
let column = vscode.ViewColumn.Active;
42+
if (options?.beside) {
43+
// "smart" Beside
44+
const ate = vscode.window.activeTextEditor;
45+
column = (ate === undefined || ate.viewColumn === vscode.ViewColumn.One) ?
46+
vscode.ViewColumn.Two :
47+
vscode.ViewColumn.One;
48+
}
3649

3750
if (InstallJdkPage.instance) {
3851
InstallJdkPage.instance._panel?.reveal();
3952
} else {
40-
InstallJdkPage.instance = webviewPanel ?
41-
new InstallJdkPage(extensionPath, webviewPanel) :
53+
InstallJdkPage.instance = options?.webviewPanel ?
54+
new InstallJdkPage(extensionPath, options.webviewPanel) :
4255
new InstallJdkPage(extensionPath, column);
4356
}
4457
}
@@ -60,6 +73,10 @@ class InstallJdkPage {
6073
});
6174
}
6275

76+
this._panel.iconPath = {
77+
light: vscode.Uri.file(path.join(extensionPath, "caption.light.svg")),
78+
dark: vscode.Uri.file(path.join(extensionPath, "caption.dark.svg"))
79+
};
6380
this._panel.webview.html = this._getHtmlForWebview();
6481

6582
this._panel.onDidDispose(() => this.dispose(), null, this._disposables);

src/welcome/assets/components/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const DEV_BLOG_LINK = "https://devblogs.microsoft.com/?s=Java+on+Visual+Studio+C
1010
export default class Header extends React.Component {
1111
render() {
1212
const openBlogCommand = encodeCommandUriWithTelemetry(WEBVIEW_ID, "blogs", "java.helper.openUrl", [DEV_BLOG_LINK]);
13-
const title = <h2>Java Tools</h2>;
13+
const title = <h2>Java Help Center</h2>;
1414
const blogsLink = <a href={openBlogCommand}>blogs</a>;
1515
const subtitle = <span>Check our {blogsLink} to see what's new</span>;
1616
return (

src/welcome/index.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,19 @@ export async function showWelcomeWebview(context: vscode.ExtensionContext, _oper
2929
welcomeView.reveal();
3030
fetchInitProps(context);
3131
} else {
32-
const viewColumn = options?.openBeside ? vscode.ViewColumn.Beside : vscode.ViewColumn.Active;
32+
let column = vscode.ViewColumn.Active;
33+
if (options?.openBeside) {
34+
// "smart" Beside
35+
const ate = vscode.window.activeTextEditor;
36+
column = (ate === undefined || ate.viewColumn === vscode.ViewColumn.One) ?
37+
vscode.ViewColumn.Two :
38+
vscode.ViewColumn.One;
39+
}
40+
3341
welcomeView = vscode.window.createWebviewPanel(
3442
"java.welcome",
3543
"Java Help Center",
36-
viewColumn,
44+
column,
3745
{
3846
enableScripts: true,
3947
enableCommandUris: true,

0 commit comments

Comments
 (0)