Use a bat launcher to set page code (#625)
This commit is contained in:
parent
6c8fed7a99
commit
07ce6f7a3c
|
@ -0,0 +1,7 @@
|
|||
@echo off
|
||||
|
||||
REM Change code page to UTF-8 for better compatibility.
|
||||
@chcp.com 65001 > NUL
|
||||
|
||||
REM Execute real command passed by args
|
||||
%*
|
|
@ -237,6 +237,10 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
|
|||
config.shortenCommandLine = await detectLaunchCommandStyle(config);
|
||||
}
|
||||
|
||||
if (process.platform === "win32" && config.request === "launch" && config.console !== "internalConsole") {
|
||||
config.launcherScript = utility.getLauncherScriptPath();
|
||||
}
|
||||
|
||||
const debugServerPort = await lsPlugin.startDebugSession();
|
||||
if (debugServerPort) {
|
||||
config.debugServer = debugServerPort;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import * as path from "path";
|
||||
import * as vscode from "vscode";
|
||||
import { setUserError } from "vscode-extension-telemetry-wrapper";
|
||||
import { logger, Type } from "./logger";
|
||||
|
@ -8,6 +9,7 @@ import { logger, Type } from "./logger";
|
|||
const TROUBLESHOOTING_LINK = "https://github.com/Microsoft/vscode-java-debug/blob/master/Troubleshooting.md";
|
||||
const LEARN_MORE = "Learn More";
|
||||
const JAVA_EXTENSION_ID = "redhat.java";
|
||||
const DEBUGGER_EXTENSION_ID = "vscjava.vscode-java-debug";
|
||||
|
||||
export class UserError extends Error {
|
||||
public context: ITroubleshootingMessage;
|
||||
|
@ -158,3 +160,8 @@ export function isJavaExtEnabled(): boolean {
|
|||
const javaExt = vscode.extensions.getExtension(JAVA_EXTENSION_ID);
|
||||
return !!javaExt;
|
||||
}
|
||||
|
||||
export function getLauncherScriptPath() {
|
||||
const ext = vscode.extensions.getExtension(DEBUGGER_EXTENSION_ID);
|
||||
return path.join(ext.extensionPath, "scripts", "launcher.bat");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue