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

Fix child process issue, and use shorter name of the open in browser … #11

Merged
merged 2 commits into from
Dec 11, 2017
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"tomcatExt.noserver": "Tomcat server is undefined",
"tomcatExt.alreadyexist": "This tomcat server exists in the workspace, abort creation",
"tomcatExt.noworkspacefolder": "The selected package is not under current workspace",
"tomcatExt.noconfig": "The tomcat server is broken. It does not have server.xml"
"tomcatExt.noconfig": "The tomcat server is broken. It does not have server.xml",
"tomcatExt.open": "Open {0}."
}
13 changes: 12 additions & 1 deletion src/Tomcat/TomcatController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,20 @@ export class TomcatController {
}

public dispose(): void {
this.stopServers();
this._tomcat.saveServerListSync();
this._outputChannels.forEach((value: vscode.OutputChannel, key: string) => value.dispose());
}

private stopServers(): void {
const serverList: TomcatServer[] = this._tomcat.getServerSet();
serverList.forEach((value: TomcatServer) => {
if (value.isStarted()) {
this.stopServer(value);
}
});
}

private setStarted(serverInfo: TomcatServer, started: boolean): void {
serverInfo.setStarted(started);
this._onDidChangeTreeData.fire();
Expand Down Expand Up @@ -204,7 +214,8 @@ export class TomcatController {

// tslint:disable-next-line:no-http-string
const serviceuri: string = `http://localhost:${serverPort}/${appName}`;
statusBar.text = `Open http://localhost:${serverPort}/${appName}`;
statusBar.text = '$(browser) Open in browser';
statusBar.tooltip = Utility.localize('tomcatExt.open', 'Open: "{0}"', serviceuri);
statusBarCommand = vscode.commands.registerCommand(statusBar.command, async () => {
opn(serviceuri);
});
Expand Down