File tree Expand file tree Collapse file tree 14 files changed +19
-17
lines changed
debugger/extension/configuration/resolvers Expand file tree Collapse file tree 14 files changed +19
-17
lines changed Original file line number Diff line number Diff line change 1+ Fix all typescript errors when compiled in strict mode
Original file line number Diff line number Diff line change @@ -106,8 +106,8 @@ export class LanguageServerExtensionActivationService implements IExtensionActiv
106106 const activatedWkspcFoldersRemoved = activatedWkspcKeys . filter ( item => workspaceKeys . indexOf ( item ) < 0 ) ;
107107 if ( activatedWkspcFoldersRemoved . length > 0 ) {
108108 for ( const folder of activatedWkspcFoldersRemoved ) {
109- this . lsActivatedWorkspaces . get ( folder ) . dispose ( ) ;
110- this . lsActivatedWorkspaces . delete ( folder ) ;
109+ this . lsActivatedWorkspaces . get ( folder ) ! . dispose ( ) ;
110+ this . lsActivatedWorkspaces ! . delete ( folder ) ;
111111 }
112112 }
113113 }
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export class LanguageServerExtension implements ILanguageServerExtension {
2323 this . disposable . dispose ( ) ;
2424 }
2525 }
26- public register ( ) : Promise < void > {
26+ public async register ( ) : Promise < void > {
2727 if ( this . disposable ) {
2828 return ;
2929 }
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ import {
4747} from 'vscode' ;
4848import * as vsls from 'vsls/vscode' ;
4949
50- import { IAsyncDisposable } from '../types' ;
50+ import { IAsyncDisposable , Resource } from '../types' ;
5151
5252// tslint:disable:no-any unified-signatures
5353
@@ -581,7 +581,7 @@ export interface IWorkspaceService {
581581 * @param uri An uri.
582582 * @return A workspace folder or `undefined`
583583 */
584- getWorkspaceFolder ( uri : Uri ) : WorkspaceFolder | undefined ;
584+ getWorkspaceFolder ( uri : Resource ) : WorkspaceFolder | undefined ;
585585
586586 /**
587587 * Generate a key that's unique to the workspace folder (could be fsPath).
Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ export class WorkspaceService implements IWorkspaceService {
2626 public getConfiguration ( section ?: string , resource ?: Uri ) : WorkspaceConfiguration {
2727 return workspace . getConfiguration ( section , resource ) ;
2828 }
29- public getWorkspaceFolder ( uri : Uri ) : WorkspaceFolder | undefined {
30- return workspace . getWorkspaceFolder ( uri ) ;
29+ public getWorkspaceFolder ( uri : Resource ) : WorkspaceFolder | undefined {
30+ return uri ? workspace . getWorkspaceFolder ( uri ) : undefined ;
3131 }
3232 public asRelativePath ( pathOrUri : string | Uri , includeWorkspaceFolder ?: boolean ) : string {
3333 return workspace . asRelativePath ( pathOrUri , includeWorkspaceFolder ) ;
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ export function parseEnvFile(
6868 baseVars ?: EnvironmentVariables
6969) : EnvironmentVariables {
7070 const globalVars = baseVars ? baseVars : { } ;
71- const vars = { } ;
71+ const vars : EnvironmentVariables = { } ;
7272 lines . toString ( ) . split ( '\n' ) . forEach ( ( line , idx ) => {
7373 const [ name , value ] = parseEnvLine ( line ) ;
7474 if ( name === '' ) {
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export class CellMatcher {
3333 }
3434
3535 public exec ( code : string ) : string | undefined {
36- let result : RegExpExecArray ;
36+ let result : RegExpExecArray | null = null ;
3737 if ( this . codeMatchRegEx . test ( code ) ) {
3838 this . codeExecRegEx . lastIndex = - 1 ;
3939 result = this . codeExecRegEx . exec ( code ) ;
Original file line number Diff line number Diff line change @@ -50,6 +50,6 @@ export class HistoryMessageListener implements IWebPanelMessageListener {
5050 }
5151
5252 private getHistoryMessages ( ) : string [ ] {
53- return Object . keys ( HistoryMessages ) . map ( k => HistoryMessages [ k ] . toString ( ) ) ;
53+ return Object . keys ( HistoryMessages ) . map ( k => ( HistoryMessages as any ) [ k ] . toString ( ) ) ;
5454 }
5555}
Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ export class PostOffice implements IAsyncDisposable {
223223 const jsonArray = JSON . parse ( a . args ) as JSONArray ;
224224 if ( jsonArray !== null && jsonArray . length >= 2 ) {
225225 const firstArg = jsonArray [ 0 ] ; // More stupid hygiene problems.
226- const command = firstArg !== null ? firstArg . toString ( ) : '' ;
226+ const command = firstArg !== null ? firstArg ! . toString ( ) : '' ;
227227 this . postCommand ( command , ...jsonArray . slice ( 1 ) ) . ignoreErrors ( ) ;
228228 }
229229 }
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ import { IDebugConfigurationResolver } from '../types';
2020
2121@injectable ( )
2222export abstract class BaseConfigurationResolver < T extends DebugConfiguration > implements IDebugConfigurationResolver < T > {
23- protected pythonPathSource : PythonPathSource ;
23+ protected pythonPathSource : PythonPathSource = PythonPathSource . launchJson ;
2424 constructor ( protected readonly workspaceService : IWorkspaceService ,
2525 protected readonly documentManager : IDocumentManager ,
2626 protected readonly configurationService : IConfigurationService ) { }
You can’t perform that action at this time.
0 commit comments