File tree 7 files changed +16
-23
lines changed
7 files changed +16
-23
lines changed Original file line number Diff line number Diff line change @@ -428,20 +428,18 @@ export class PickPSHostProcessFeature extends LanguageClientConsumer {
428
428
pid : "current" ,
429
429
} ] ;
430
430
431
- const hostProcesses = await this . languageClient ?. sendRequest ( GetPSHostProcessesRequestType , { } ) ;
432
- for ( const p in hostProcesses ) {
433
- if ( hostProcesses . hasOwnProperty ( p ) ) {
431
+ const response = await this . languageClient ?. sendRequest ( GetPSHostProcessesRequestType , { } ) ;
432
+ for ( const process of response ?. hostProcesses ?? [ ] ) {
434
433
let windowTitle = "" ;
435
- if ( hostProcesses [ p ] . mainWindowTitle ) {
436
- windowTitle = `, Title: ${ hostProcesses [ p ] . mainWindowTitle } ` ;
434
+ if ( process . mainWindowTitle ) {
435
+ windowTitle = `, Title: ${ process . mainWindowTitle } ` ;
437
436
}
438
437
439
438
items . push ( {
440
- label : hostProcesses [ p ] . processName ,
441
- description : `PID: ${ hostProcesses [ p ] . processId . toString ( ) } ${ windowTitle } ` ,
442
- pid : hostProcesses [ p ] . processId ,
439
+ label : process . processName ,
440
+ description : `PID: ${ process . processId . toString ( ) } ${ windowTitle } ` ,
441
+ pid : process . processId ,
443
442
} ) ;
444
- }
445
443
}
446
444
447
445
if ( items . length === 0 ) {
Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ class Command extends vscode.TreeItem {
139
139
} ;
140
140
}
141
141
142
- public async getChildren ( _element ?) : Promise < Command [ ] > {
142
+ public async getChildren ( _element ?: any ) : Promise < Command [ ] > {
143
143
return [ ] ;
144
144
// Returning an empty array because we need to return something.
145
145
}
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export class HelpCompletionFeature extends LanguageClientConsumer {
25
25
26
26
if ( this . settings . helpCompletion !== Settings . CommentType . Disabled ) {
27
27
this . helpCompletionProvider = new HelpCompletionProvider ( ) ;
28
- const subscriptions = [ ] ;
28
+ const subscriptions : Disposable [ ] = [ ] ;
29
29
workspace . onDidChangeTextDocument ( this . onEvent , this , subscriptions ) ;
30
30
this . disposable = Disposable . from ( ...subscriptions ) ;
31
31
}
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ export class RemoteFilesFeature extends LanguageClientConsumer {
60
60
const remoteDocuments =
61
61
vscode . workspace . textDocuments . filter ( ( doc ) => this . isDocumentRemote ( doc ) ) ;
62
62
63
- async function innerCloseFiles ( ) {
63
+ async function innerCloseFiles ( ) : Promise < void > {
64
64
const doc = remoteDocuments . pop ( ) ;
65
65
if ( doc === undefined ) {
66
66
return ;
Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ export class Logger implements ILogger {
135
135
}
136
136
137
137
public async startNewLog ( minimumLogLevel : string = "Normal" ) : Promise < void > {
138
- this . MinimumLogLevel = this . logLevelNameToValue ( minimumLogLevel . trim ( ) ) ;
138
+ this . MinimumLogLevel = Logger . logLevelNameToValue ( minimumLogLevel ) ;
139
139
140
140
this . logSessionPath =
141
141
vscode . Uri . joinPath (
@@ -146,8 +146,9 @@ export class Logger implements ILogger {
146
146
await vscode . workspace . fs . createDirectory ( this . logSessionPath ) ;
147
147
}
148
148
149
- private logLevelNameToValue ( logLevelName : string ) : LogLevel {
150
- switch ( logLevelName . toLowerCase ( ) ) {
149
+ // TODO: Make the enum smarter about strings so this goes away.
150
+ public static logLevelNameToValue ( logLevelName : string ) : LogLevel {
151
+ switch ( logLevelName . trim ( ) . toLowerCase ( ) ) {
151
152
case "diagnostic" : return LogLevel . Diagnostic ;
152
153
case "verbose" : return LogLevel . Verbose ;
153
154
case "normal" : return LogLevel . Normal ;
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<IPower
122
122
123
123
// Setup the logger.
124
124
logger = new Logger ( context . globalStorageUri ) ;
125
- logger . MinimumLogLevel = LogLevel [ settings . developer . editorServicesLogLevel ] ;
125
+ logger . MinimumLogLevel = Logger . logLevelNameToValue ( settings . developer . editorServicesLogLevel ) ;
126
126
127
127
sessionManager = new SessionManager (
128
128
context ,
Original file line number Diff line number Diff line change 11
11
],
12
12
"sourceMap" : true ,
13
13
"rootDir" : " ." ,
14
- // TODO: We need to enable stricter checking...
15
- // "strict": true,
16
- "strictBindCallApply" : true ,
17
- "strictFunctionTypes" : true ,
18
- "strictNullChecks" : true ,
19
- "strictPropertyInitialization" : true ,
20
- "useUnknownInCatchVariables" : true ,
14
+ "strict" : true ,
21
15
"noImplicitReturns" : true ,
22
16
"noFallthroughCasesInSwitch" : true ,
23
17
"noUnusedParameters" : true
You can’t perform that action at this time.
0 commit comments