@@ -4,7 +4,6 @@ import * as fs from "fs";
44import * as _ from "lodash" ;
55import * as os from "os" ;
66import * as path from "path" ;
7- import { debug } from "util" ;
87import * as vscode from "vscode" ;
98
109import { instrumentOperation , sendInfo } from "vscode-extension-telemetry-wrapper" ;
@@ -19,7 +18,7 @@ import { mainClassPicker } from "./mainClassPicker";
1918import { resolveJavaProcess } from "./processPicker" ;
2019import * as utility from "./utility" ;
2120
22- const platformNameMappings = {
21+ const platformNameMappings : { [ key : string ] : string } = {
2322 win32 : "windows" ,
2423 linux : "linux" ,
2524 darwin : "osx" ,
@@ -38,20 +37,22 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
3837 this . isUserSettingsDirty = true ;
3938 }
4039 }
40+ return undefined ;
4141 } ) ;
4242 }
4343
4444 // Returns an initial debug configurations based on contextual information.
45- public provideDebugConfigurations ( folder : vscode . WorkspaceFolder | undefined , token ?: vscode . CancellationToken ) :
45+ public provideDebugConfigurations ( folder : vscode . WorkspaceFolder | undefined , _token ?: vscode . CancellationToken ) :
4646 vscode . ProviderResult < vscode . DebugConfiguration [ ] > {
47- const provideDebugConfigurationsHandler = instrumentOperation ( "provideDebugConfigurations" , ( operationId : string ) => {
47+ const provideDebugConfigurationsHandler = instrumentOperation ( "provideDebugConfigurations" , ( _operationId : string ) => {
4848 return < Thenable < vscode . DebugConfiguration [ ] > > this . provideDebugConfigurationsAsync ( folder ) ;
4949 } ) ;
5050 return provideDebugConfigurationsHandler ( ) ;
5151 }
5252
5353 // Try to add all missing attributes to the debug configuration being launched.
54- public resolveDebugConfiguration ( folder : vscode . WorkspaceFolder | undefined , config : vscode . DebugConfiguration , token ?: vscode . CancellationToken ) :
54+ public resolveDebugConfiguration ( _folder : vscode . WorkspaceFolder | undefined ,
55+ config : vscode . DebugConfiguration , _token ?: vscode . CancellationToken ) :
5556 vscode . ProviderResult < vscode . DebugConfiguration > {
5657 // If no debug configuration is provided, then generate one in memory.
5758 if ( this . isEmptyConfig ( config ) ) {
@@ -67,8 +68,8 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
6768 public resolveDebugConfigurationWithSubstitutedVariables (
6869 folder : vscode . WorkspaceFolder | undefined ,
6970 config : vscode . DebugConfiguration ,
70- token ?: vscode . CancellationToken ) : vscode . ProviderResult < vscode . DebugConfiguration > {
71- const resolveDebugConfigurationHandler = instrumentOperation ( "resolveDebugConfiguration" , ( operationId : string ) => {
71+ _token ?: vscode . CancellationToken ) : vscode . ProviderResult < vscode . DebugConfiguration > {
72+ const resolveDebugConfigurationHandler = instrumentOperation ( "resolveDebugConfiguration" , ( _operationId : string ) => {
7273 try {
7374 // See https://github.com/microsoft/vscode-java-debug/issues/778
7475 // Merge the platform specific properties to the global config to simplify the subsequent resolving logic.
@@ -85,9 +86,9 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
8586 return resolveDebugConfigurationHandler ( ) ;
8687 }
8788
88- private provideDebugConfigurationsAsync ( folder : vscode . WorkspaceFolder | undefined , token ?: vscode . CancellationToken ) {
89+ private provideDebugConfigurationsAsync ( folder : vscode . WorkspaceFolder | undefined , _token ?: vscode . CancellationToken ) {
8990 return vscode . window . withProgress ( { location : vscode . ProgressLocation . Window } , ( p ) => {
90- return new Promise ( async ( resolve , reject ) => {
91+ return new Promise ( async ( resolve , _reject ) => {
9192 p . report ( { message : "Auto generating configuration..." } ) ;
9293 const defaultLaunchConfig = {
9394 type : "java" ,
@@ -104,7 +105,7 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
104105 }
105106
106107 const mainClasses = await lsPlugin . resolveMainClass ( folder ? folder . uri : undefined ) ;
107- let cache ;
108+ let cache : { [ key : string ] : any } ;
108109 cache = { } ;
109110 const launchConfigs = mainClasses . map ( ( item ) => {
110111 return {
@@ -126,7 +127,7 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
126127 } ) ;
127128 }
128129
129- private mergePlatformProperties ( folder : vscode . WorkspaceFolder , config : vscode . DebugConfiguration ) {
130+ private mergePlatformProperties ( _folder : vscode . WorkspaceFolder , config : vscode . DebugConfiguration ) {
130131 if ( config && platformName && config [ platformName ] ) {
131132 try {
132133 for ( const key of Object . keys ( config [ platformName ] ) ) {
@@ -139,7 +140,7 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
139140 }
140141 }
141142
142- private constructLaunchConfigName ( mainClass : string , projectName : string , cache : { } ) {
143+ private constructLaunchConfigName ( mainClass : string , projectName : string , cache : { [ key : string ] : any } ) {
143144 const prefix = "Debug (Launch)-" ;
144145 let name = prefix + mainClass . substr ( mainClass . lastIndexOf ( "." ) + 1 ) ;
145146 if ( projectName !== undefined ) {
@@ -199,7 +200,7 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
199200 const mainClassOption = await this . resolveLaunchConfig ( folder ? folder . uri : undefined , config ) ;
200201 if ( ! mainClassOption || ! mainClassOption . mainClass ) { // Exit silently if the user cancels the prompt fix by ESC.
201202 // Exit the debug session.
202- return ;
203+ return undefined ;
203204 }
204205
205206 config . mainClass = mainClassOption . mainClass ;
@@ -406,7 +407,7 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
406407 return selectedFix ;
407408 }
408409 // return undefined if the user clicks "Learn More".
409- return ;
410+ return undefined ;
410411 }
411412
412413 throw new utility . UserError ( {
0 commit comments