File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Flag ` program ` in ` launch.json ` configuration items as an optional attribute.
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export interface BaseLaunchRequestArguments extends DebugProtocol.LaunchRequestA
7171 type ?: DebuggerType ;
7272 /** An absolute path to the program to debug. */
7373 module ?: string ;
74- program : string ;
74+ program ? : string ;
7575 pythonPath : string ;
7676 /** Automatically stop target after launch. If not specified, target does not stop. */
7777 stopOnEntry ?: boolean ;
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ export class PythonDebugger extends LoggingDebugSession {
9292 private startDebugServer ( ) : Promise < IDebugServer > {
9393 let programDirectory = '' ;
9494 if ( ( this . launchArgs && this . launchArgs . program ) || ( this . attachArgs && this . attachArgs . localRoot ) ) {
95- programDirectory = this . launchArgs ? path . dirname ( this . launchArgs . program ) : this . attachArgs . localRoot ;
95+ programDirectory = ( this . launchArgs && this . launchArgs . program ) ? path . dirname ( this . launchArgs . program ) : this . attachArgs . localRoot ;
9696 }
9797 if ( this . launchArgs && typeof this . launchArgs . cwd === 'string' && this . launchArgs . cwd . length > 0 && this . launchArgs . cwd !== 'null' ) {
9898 programDirectory = this . launchArgs . cwd ;
@@ -227,7 +227,7 @@ export class PythonDebugger extends LoggingDebugSession {
227227 }
228228 // Confirm the file exists
229229 if ( typeof args . module !== 'string' || args . module . length === 0 ) {
230- if ( ! fs . existsSync ( args . program ) ) {
230+ if ( ! args . program || ! fs . existsSync ( args . program ) ) {
231231 return this . sendErrorResponse ( response , 2001 , `File does not exist. "${ args . program } "` ) ;
232232 }
233233 }
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export class Generator implements vscode.Disposable {
3131 if ( ! this . pythonSettings . workspaceSymbols . enabled ) {
3232 return ;
3333 }
34- return await this . generateTags ( { directory : this . workspaceFolder . fsPath } ) ;
34+ return this . generateTags ( { directory : this . workspaceFolder . fsPath } ) ;
3535 }
3636 private buildCmdArgs ( ) : string [ ] {
3737 const exclusions = this . pythonSettings . workspaceSymbols . exclusionPatterns ;
@@ -40,7 +40,7 @@ export class Generator implements vscode.Disposable {
4040 return [ `--options=${ this . optionsFile } ` , '--languages=Python' ] . concat ( excludes ) ;
4141 }
4242 @captureTelemetry ( WORKSPACE_SYMBOLS_BUILD )
43- private generateTags ( source : { directory ?: string , file ?: string } ) : Promise < void > {
43+ private generateTags ( source : { directory ?: string ; file ?: string } ) : Promise < void > {
4444 const tagFile = path . normalize ( this . pythonSettings . workspaceSymbols . tagFilePath ) ;
4545 const cmd = this . pythonSettings . workspaceSymbols . ctagsPath ;
4646 const args = this . buildCmdArgs ( ) ;
You can’t perform that action at this time.
0 commit comments