import { DebugConfiguration , WorkspaceFolder } from 'vscode' ; import { hostStartTaskName , localhost } from '../constants' ; import { localize } from '../localize' ; import { FuncDebugProviderBase } from './FuncDebugProviderBase' ; export const defaultJavaDebugPort = 5005 ; export const javaDebugConfig = { name : localize ( 'attachJava' , 'Attach to Java Functions' ) , type : 'java' , request : 'attach' , hostName : localhost , port : defaultJavaDebugPort , preLaunchTask : hostStartTaskName } ; export class JavaDebugProvider extends FuncDebugProviderBase { public readonly workerArgKey : string = 'languageWorkers__java__arguments' ; protected readonly defaultPortOrPipeName : number = defaultJavaDebugPort ; protected readonly debugConfig : DebugConfiguration = javaDebugConfig ; public async getWorkerArgValue ( folder ) { const port = this . getDebugPortOrPipeName ( folder ) ; return `-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=${ port }` ; } }