Skip to content

Commit 0289e29

Browse files
Remove existing encoding workarounds from client side (#1077)
* Remove existing encoding workarounds from client side
1 parent 459ca3f commit 0289e29

File tree

7 files changed

+7
-23
lines changed

7 files changed

+7
-23
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Please also check the documentation of [Language Support for Java by Red Hat](ht
5353
- `sourcePaths` - The extra source directories of the program. The debugger looks for source code from project settings by default. This option allows the debugger to look for source code in extra directories.
5454
- `modulePaths` - The modulepaths for launching the JVM. If not specified, the debugger will automatically resolve from current project.
5555
- `classPaths` - The classpaths for launching the JVM. If not specified, the debugger will automatically resolve from current project.
56-
- `encoding` - The `file.encoding` setting for the JVM. If not specified, 'UTF-8' will be used. Possible values can be found in https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html.
56+
- `encoding` - The `file.encoding` setting for the JVM. Possible values can be found in https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html.
5757
- `vmArgs` - The extra options and system properties for the JVM (e.g. -Xms\<size\> -Xmx\<size\> -D\<name\>=\<value\>), it accepts a string or an array of string.
5858
- `projectName` - The preferred project in which the debugger searches for classes. There could be duplicated class names in different projects. This setting also works when the debugger looks for the specified main class when launching a program. It is required when the workspace has multiple java projects, otherwise the expression evaluation and conditional breakpoint may not work.
5959
- `cwd` - The working directory of the program. Defaults to `${workspaceFolder}`.

package.nls.es.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"java.debugger.launch.modulePaths.description": "Los modulepaths para el lanzamiento de la JVM. Si no se especifica, el depurador se resolverá automáticamente a partir del proyecto actual.",
77
"java.debugger.launch.classPaths.description": "Los classpath para el lanzamiento de la JVM. Si no se especifica, el depurador se resolverá automáticamente a partir del proyecto actual.",
88
"java.debugger.launch.sourcePaths.description": "Los directorios de fuentes extras del programa. El depurador busca el código fuente de los ajustes del proyecto por defecto. Esta opción permite al depurador buscar el código fuente en directorios extra.",
9-
"java.debugger.launch.encoding.description": "La configuración de codificación de archivos para la JVM. Si no se especifica, se usará 'UTF-8'. Los posibles valores se pueden encontrar en https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html.",
9+
"java.debugger.launch.encoding.description": "La configuración de codificación de archivos para la JVM. Los posibles valores se pueden encontrar en https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html.",
1010
"java.debugger.launch.cwd.description": "El directorio de trabajo del programa. Por defecto es la raíz del área de trabajo actual.",
1111
"java.debugger.launch.env.description": "Las variables de entorno adicionales para el programa.",
1212
"java.debugger.launch.stopOnEntry.description": "Pausar automáticamente el programa después del lanzamiento.",

package.nls.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"java.debugger.launch.classPaths.test": "The classpaths within 'test' scope of current project.",
1515
"java.debugger.launch.classPaths.exclude": "The path after '!' will be excluded from the classpaths.",
1616
"java.debugger.launch.sourcePaths.description": "The extra source directories of the program. The debugger looks for source code from project settings by default. This option allows the debugger to look for source code in extra directories.",
17-
"java.debugger.launch.encoding.description": "The file.encoding setting for the JVM. If not specified, 'UTF-8' will be used. Possible values can be found in https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html.",
17+
"java.debugger.launch.encoding.description": "The file.encoding setting for the JVM. Possible values can be found in https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html.",
1818
"java.debugger.launch.cwd.description": "The working directory of the program. Defaults to the current workspace root.",
1919
"java.debugger.launch.env.description": "The extra environment variables for the program.",
2020
"java.debugger.launch.envFile.description": "Absolute path to a file containing environment variable definitions.",

package.nls.zh.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"java.debugger.launch.classPaths.test": "当前工程中属于 test 作用域的类路径。",
1515
"java.debugger.launch.classPaths.exclude": "'!' 之后的路径将会从类路径中去除。",
1616
"java.debugger.launch.sourcePaths.description": "应用程序的额外源代码目录。调试器默认从工程配置中查找源代码。此选项允许调试器在额外目录中查找源代码。",
17-
"java.debugger.launch.encoding.description": "JVM的file.encoding设置。如果未指定,将使用“UTF-8”。可以在http://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html中找到可能的值。",
17+
"java.debugger.launch.encoding.description": "JVM的file.encoding设置。可以在http://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html中找到可能的值。",
1818
"java.debugger.launch.cwd.description": "应用程序的工作目录。默认为当前工作空间根目录。",
1919
"java.debugger.launch.env.description": "启动应用程序时自定义的环境变量。",
2020
"java.debugger.launch.envFile.description": "环境变量文件绝对路径。",

scripts/launcher.bat

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/configurationProvider.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,9 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
315315
config.shortenCommandLine = await getShortenApproachForCLI(config, targetJavaVersion);
316316
}
317317

318-
if (process.platform === "win32" && config.console !== "internalConsole") {
319-
const launcherScript: string = utility.getLauncherScriptPath();
320-
if (!launcherScript.includes(" ") || !utility.isGitBash(config.console === "integratedTerminal")) {
321-
config.launcherScript = launcherScript;
322-
}
318+
// VS Code internal console uses UTF-8 to display output by default.
319+
if (config.console === "internalConsole" && !config.encoding) {
320+
config.encoding = "UTF-8";
323321
}
324322
} else if (config.request === "attach") {
325323
if (config.hostName && config.port && Number.isInteger(Number(config.port))) {

src/utility.ts

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

4-
import * as path from "path";
54
import * as vscode from "vscode";
65
import { sendError, sendInfo, setUserError } from "vscode-extension-telemetry-wrapper";
76
import { Type } from "./javaLogger";
@@ -11,7 +10,6 @@ import { IProgressReporter } from "./progressAPI";
1110
const TROUBLESHOOTING_LINK = "https://github.com/Microsoft/vscode-java-debug/blob/master/Troubleshooting.md";
1211
const LEARN_MORE = "Learn More";
1312
const JAVA_EXTENSION_ID = "redhat.java";
14-
const DEBUGGER_EXTENSION_ID = "vscjava.vscode-java-debug";
1513

1614
export class UserError extends Error {
1715
public context: ITroubleshootingMessage;
@@ -202,11 +200,6 @@ export function isJavaExtActivated(): boolean {
202200
return !!javaExt && javaExt.isActive;
203201
}
204202

205-
export function getLauncherScriptPath() {
206-
const ext = vscode.extensions.getExtension(DEBUGGER_EXTENSION_ID)!;
207-
return path.join(ext.extensionPath, "scripts", "launcher.bat");
208-
}
209-
210203
export function isGitBash(isIntegratedTerminal: boolean): boolean {
211204
const currentWindowsShellPath: string | undefined = isIntegratedTerminal ? vscode.env.shell :
212205
vscode.workspace.getConfiguration("terminal")?.get("external.windowsExec");

0 commit comments

Comments
 (0)