@@ -80,9 +80,9 @@ export class CLIServerBase {
8080 }
8181
8282 private onRequest ( req : http . IncomingMessage , res : http . ServerResponse ) : void {
83- const sendResponse = ( statusCode : number , returnObj : any ) => {
83+ const sendResponse = ( statusCode : number , returnObj : string | undefined ) => {
8484 res . writeHead ( statusCode , { 'content-type' : 'application/json' } ) ;
85- res . end ( JSON . stringify ( returnObj || null ) , ( err ?: any ) => err && this . logService . error ( err ) ) ;
85+ res . end ( JSON . stringify ( returnObj || null ) , ( err ?: any ) => err && this . logService . error ( err ) ) ; // CodeQL [SM01524] Only the message portion of errors are passed in.
8686 } ;
8787
8888 const chunks : string [ ] = [ ] ;
@@ -91,7 +91,7 @@ export class CLIServerBase {
9191 req . on ( 'end' , async ( ) => {
9292 try {
9393 const data : PipeCommand | any = JSON . parse ( chunks . join ( '' ) ) ;
94- let returnObj ;
94+ let returnObj : string | undefined ;
9595 switch ( data . type ) {
9696 case 'open' :
9797 returnObj = await this . open ( data ) ;
@@ -118,7 +118,7 @@ export class CLIServerBase {
118118 } ) ;
119119 }
120120
121- private async open ( data : OpenCommandPipeArgs ) : Promise < string > {
121+ private async open ( data : OpenCommandPipeArgs ) : Promise < undefined > {
122122 const { fileURIs, folderURIs, forceNewWindow, diffMode, mergeMode, addMode, forceReuseWindow, gotoLineMode, waitMarkerFilePath, remoteAuthority } = data ;
123123 const urisToOpen : IWindowOpenable [ ] = [ ] ;
124124 if ( Array . isArray ( folderURIs ) ) {
@@ -147,31 +147,29 @@ export class CLIServerBase {
147147 const preferNewWindow = ! forceReuseWindow && ! waitMarkerFileURI && ! addMode ;
148148 const windowOpenArgs : IOpenWindowOptions = { forceNewWindow, diffMode, mergeMode, addMode, gotoLineMode, forceReuseWindow, preferNewWindow, waitMarkerFileURI, remoteAuthority } ;
149149 this . _commands . executeCommand ( '_remoteCLI.windowOpen' , urisToOpen , windowOpenArgs ) ;
150-
151- return '' ;
152150 }
153151
154- private async openExternal ( data : OpenExternalCommandPipeArgs ) : Promise < any > {
152+ private async openExternal ( data : OpenExternalCommandPipeArgs ) : Promise < undefined > {
155153 for ( const uriString of data . uris ) {
156154 const uri = URI . parse ( uriString ) ;
157155 const urioOpen = uri . scheme === 'file' ? uri : uriString ; // workaround for #112577
158156 await this . _commands . executeCommand ( '_remoteCLI.openExternal' , urioOpen ) ;
159157 }
160158 }
161159
162- private async manageExtensions ( data : ExtensionManagementPipeArgs ) : Promise < any > {
160+ private async manageExtensions ( data : ExtensionManagementPipeArgs ) : Promise < string | undefined > {
163161 const toExtOrVSIX = ( inputs : string [ ] | undefined ) => inputs ?. map ( input => / \. v s i x $ / i. test ( input ) ? URI . parse ( input ) : input ) ;
164162 const commandArgs = {
165163 list : data . list ,
166164 install : toExtOrVSIX ( data . install ) ,
167165 uninstall : toExtOrVSIX ( data . uninstall ) ,
168166 force : data . force
169167 } ;
170- return await this . _commands . executeCommand ( '_remoteCLI.manageExtensions' , commandArgs ) ;
168+ return await this . _commands . executeCommand < string | undefined > ( '_remoteCLI.manageExtensions' , commandArgs ) ;
171169 }
172170
173- private async getStatus ( data : StatusPipeArgs ) {
174- return await this . _commands . executeCommand ( '_remoteCLI.getSystemStatus' ) ;
171+ private async getStatus ( data : StatusPipeArgs ) : Promise < string | undefined > {
172+ return await this . _commands . executeCommand < string | undefined > ( '_remoteCLI.getSystemStatus' ) ;
175173 }
176174
177175 dispose ( ) : void {
0 commit comments