debug args
This commit is contained in:
parent
353e76be38
commit
a451b1b2d8
|
|
@ -35,7 +35,7 @@ function findExecutable(context: vscode.ExtensionContext, configPath: string | u
|
||||||
|
|
||||||
export function activate(context: vscode.ExtensionContext) {
|
export function activate(context: vscode.ExtensionContext) {
|
||||||
const config = vscode.workspace.getConfiguration('tsl')
|
const config = vscode.workspace.getConfiguration('tsl')
|
||||||
const serverArguments = config.get<string[]>('server.arguments') || []
|
let serverArguments = config.get<string[]>('server.arguments') || []
|
||||||
|
|
||||||
const serverBinary = process.platform === 'win32' ? 'tsl-server.exe' : 'tsl-server'
|
const serverBinary = process.platform === 'win32' ? 'tsl-server.exe' : 'tsl-server'
|
||||||
let serverExe = findExecutable(
|
let serverExe = findExecutable(
|
||||||
|
|
@ -66,16 +66,18 @@ export function activate(context: vscode.ExtensionContext) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const runArgs = [...serverArguments]
|
|
||||||
const debugArgs = ['--log=trace', '--log-stderr']
|
|
||||||
|
|
||||||
if (interpreterExe) {
|
if (interpreterExe) {
|
||||||
let interpreterDir = path.dirname(interpreterExe)
|
let interpreterDir = path.dirname(interpreterExe)
|
||||||
interpreterDir = interpreterDir.replace(/\\/g, '/') + '/'
|
interpreterDir = interpreterDir.replace(/\\/g, '/') + '/'
|
||||||
runArgs.push(`--interpreter=${interpreterDir}`)
|
serverArguments = serverArguments.filter(arg => !arg.startsWith('--interpreter='))
|
||||||
debugArgs.push(`--interpreter=${interpreterDir}`)
|
serverArguments.push(`--interpreter=${interpreterDir}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const runArgs = [...serverArguments]
|
||||||
|
const debugArgs = serverArguments.map(arg => arg.startsWith('--log=') ? '--log=trace' : arg)
|
||||||
|
if (!debugArgs.some(arg => arg.startsWith('--log='))) debugArgs.push('--log=trace')
|
||||||
|
if (!debugArgs.includes('--log-stderr')) debugArgs.push('--log-stderr')
|
||||||
|
|
||||||
const serverOptions: ServerOptions = {
|
const serverOptions: ServerOptions = {
|
||||||
run: { command: serverExe, transport: TransportKind.stdio, args: runArgs },
|
run: { command: serverExe, transport: TransportKind.stdio, args: runArgs },
|
||||||
debug: { command: serverExe, transport: TransportKind.stdio, args: debugArgs }
|
debug: { command: serverExe, transport: TransportKind.stdio, args: debugArgs }
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue