Skip to content

Commit 06793b1

Browse files
akosyakovfbricon
authored andcommitted
fix #1066: use vscode.env.appName instead of hardcoding VS Code
Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
1 parent 8b11961 commit 06793b1

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function onExtensionChange(extensions: readonly vscode.Extension<any>[])
4343
}
4444

4545
if (hasChanged) {
46-
const msg = 'Extensions to the Java Language Server changed, reloading Visual Studio Code is required for the changes to take effect.';
46+
const msg = `Extensions to the Java Language Server changed, reloading ${vscode.env.appName} is required for the changes to take effect.`;
4747
const action = 'Reload';
4848
const restartId = Commands.RELOAD_WINDOW;
4949
vscode.window.showWarningMessage(msg, action).then((selection) => {

src/requirements.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
import { workspace, Uri } from 'vscode';
3+
import { workspace, Uri, env } from 'vscode';
44
import * as cp from 'child_process';
55
import * as path from 'path';
66
import * as pathExists from 'path-exists';
@@ -40,7 +40,7 @@ function checkJavaRuntime(): Promise<string> {
4040
let source: string;
4141
let javaHome: string = readJavaConfig();
4242
if (javaHome) {
43-
source = 'java.home variable defined in VS Code settings';
43+
source = `java.home variable defined in ${env.appName} settings`;
4444
} else {
4545
javaHome = process.env['JDK_HOME'];
4646
if (javaHome) {

src/settings.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
import { window, Uri, workspace, WorkspaceConfiguration, commands, ConfigurationTarget } from 'vscode';
3+
import { window, Uri, workspace, WorkspaceConfiguration, commands, ConfigurationTarget, env } from 'vscode';
44
import { LanguageClient } from 'vscode-languageclient';
55
import { Commands } from './commands';
66
import { getJavaConfiguration } from './utils';
@@ -27,7 +27,7 @@ export function onConfigurationChange() {
2727
excludeProjectSettingsFiles();
2828
}
2929
if (hasJavaConfigChanged(oldConfig, newConfig)) {
30-
const msg = 'Java Language Server configuration changed, please restart VS Code.';
30+
const msg = `Java Language Server configuration changed, please restart ${env.appName}.`;
3131
const action = 'Restart Now';
3232
const restartId = Commands.RELOAD_WINDOW;
3333
oldConfig = newConfig;
@@ -70,7 +70,7 @@ function excludeProjectSettingsFilesForWorkspace(workspaceUri: Uri) {
7070
items.unshift(changeItem.global);
7171
}
7272

73-
window.showInformationMessage('Do you want to exclude the VS Code Java project settings files (.classpath, .project. .settings, .factorypath) from the file explorer?', ...items).then((result) => {
73+
window.showInformationMessage(`Do you want to exclude the ${env.appName} Java project settings files (.classpath, .project. .settings, .factorypath) from the file explorer?`, ...items).then((result) => {
7474
if (result === changeItem.global) {
7575
excludedInspectedValue.globalValue = excludedInspectedValue.globalValue || {};
7676
for (const hiddenFile of needExcludeFiles) {

0 commit comments

Comments
 (0)