@@ -28,7 +28,7 @@ export class Storage {
2828 * If the URL is falsey, then remove it as the last used URL and do not touch
2929 * the history.
3030 */
31- public async setURL ( url ?: string ) : Promise < void > {
31+ public async setUrl ( url ?: string ) : Promise < void > {
3232 await this . memento . update ( "url" , url )
3333 if ( url ) {
3434 const history = this . withUrlHistory ( url )
@@ -85,9 +85,11 @@ export class Storage {
8585 }
8686 }
8787
88- // getRemoteSSHLogPath returns the log path for the "Remote - SSH" output panel.
89- // There is no VS Code API to get the contents of an output panel. We use this
90- // to get the active port so we can display network information.
88+ /**
89+ * Returns the log path for the "Remote - SSH" output panel. There is no VS
90+ * Code API to get the contents of an output panel. We use this to get the
91+ * active port so we can display network information.
92+ */
9193 public async getRemoteSSHLogPath ( ) : Promise < string | undefined > {
9294 const upperDir = path . dirname ( this . logUri . fsPath )
9395 // Node returns these directories sorted already!
@@ -368,18 +370,30 @@ export class Storage {
368370 : path . join ( this . globalStorageUri . fsPath , "bin" )
369371 }
370372
371- // getNetworkInfoPath returns the path where network information
372- // for SSH hosts is stored.
373+ /**
374+ * Return the path where network information for SSH hosts are stored.
375+ *
376+ * The CLI will write files here named after the process PID.
377+ */
373378 public getNetworkInfoPath ( ) : string {
374379 return path . join ( this . globalStorageUri . fsPath , "net" )
375380 }
376381
377- // getLogPath returns the path where log data from the Coder
378- // agent is stored.
382+ /**
383+ *
384+ * Return the path where log data from the connection is stored.
385+ *
386+ * The CLI will write files here named after the process PID.
387+ */
379388 public getLogPath ( ) : string {
380389 return path . join ( this . globalStorageUri . fsPath , "log" )
381390 }
382391
392+ /**
393+ * Get the path to the user's settings.json file.
394+ *
395+ * Going through VSCode's API should be preferred when modifying settings.
396+ */
383397 public getUserSettingsPath ( ) : string {
384398 return path . join ( this . globalStorageUri . fsPath , ".." , ".." , ".." , "User" , "settings.json" )
385399 }
@@ -406,7 +420,7 @@ export class Storage {
406420 *
407421 * The caller must ensure this directory exists before use.
408422 */
409- public getURLPath ( label : string ) : string {
423+ public getUrlPath ( label : string ) : string {
410424 return label
411425 ? path . join ( this . globalStorageUri . fsPath , label , "url" )
412426 : path . join ( this . globalStorageUri . fsPath , "url" )
@@ -434,7 +448,7 @@ export class Storage {
434448 * If the label is empty, read the old deployment-unaware config instead.
435449 */
436450 private async updateUrlForCli ( label : string , url : string | undefined ) : Promise < void > {
437- const urlPath = this . getURLPath ( label )
451+ const urlPath = this . getUrlPath ( label )
438452 if ( url ) {
439453 await fs . mkdir ( path . dirname ( urlPath ) , { recursive : true } )
440454 await fs . writeFile ( urlPath , url )
@@ -467,7 +481,7 @@ export class Storage {
467481 * If the label is empty, read the old deployment-unaware config.
468482 */
469483 public async readCliConfig ( label : string ) : Promise < { url : string ; token : string } > {
470- const urlPath = this . getURLPath ( label )
484+ const urlPath = this . getUrlPath ( label )
471485 const tokenPath = this . getSessionTokenPath ( label )
472486 const [ url , token ] = await Promise . allSettled ( [ fs . readFile ( urlPath , "utf8" ) , fs . readFile ( tokenPath , "utf8" ) ] )
473487 return {
0 commit comments