@@ -21,7 +21,7 @@ namespace ts.server.typingsInstaller {
2121 basePath = os . homedir ( ) ;
2222 break ;
2323 case "darwin" :
24- basePath = combinePaths ( os . homedir ( ) , "Library/Application Support/" )
24+ basePath = combinePaths ( os . homedir ( ) , "Library/Application Support/" ) ;
2525 break ;
2626 }
2727
@@ -32,7 +32,7 @@ namespace ts.server.typingsInstaller {
3232 class FileLog implements Log {
3333 constructor ( private readonly logFile ?: string ) {
3434 }
35-
35+
3636 isEnabled ( ) {
3737 return this . logFile !== undefined ;
3838 }
@@ -44,9 +44,8 @@ namespace ts.server.typingsInstaller {
4444 export class NodeTypingsInstaller extends TypingsInstaller {
4545 private execSync : { ( command : string , options : { stdio : "ignore" | "pipe" } ) : Buffer | string } ;
4646 private exec : { ( command : string , options : { cwd : string } , callback ?: ( error : Error , stdout : string , stderr : string ) => void ) : any } ;
47-
4847 private npmBinPath : string ;
49-
48+
5049 private tsdRunCount = 1 ;
5150 readonly installTypingHost : InstallTypingHost = sys ;
5251
@@ -55,7 +54,7 @@ namespace ts.server.typingsInstaller {
5554 if ( this . log . isEnabled ( ) ) {
5655 this . log . writeLine ( `Process id: ${ process . pid } ` ) ;
5756 }
58- const { exec, execSync } = require ( "child_process" ) ;
57+ const { exec, execSync } = require ( "child_process" ) ;
5958 this . execSync = execSync ;
6059 this . exec = exec ;
6160 }
@@ -68,7 +67,7 @@ namespace ts.server.typingsInstaller {
6867 this . log . writeLine ( `Global npm bin path '${ this . npmBinPath } '` ) ;
6968 }
7069 }
71- catch ( e ) {
70+ catch ( e ) {
7271 this . npmBinPath = "" ;
7372 if ( this . log . isEnabled ( ) ) {
7473 this . log . writeLine ( `Error when getting npm bin path: ${ e } . Set bin path to ""` ) ;
@@ -82,7 +81,7 @@ namespace ts.server.typingsInstaller {
8281 case "closeProject" :
8382 this . closeProject ( req ) ;
8483 }
85- } )
84+ } ) ;
8685 }
8786
8887 protected isPackageInstalled ( packageName : string ) {
@@ -121,11 +120,11 @@ namespace ts.server.typingsInstaller {
121120
122121 protected sendResponse ( response : SetTypings | InvalidateCachedTypings ) {
123122 if ( this . log . isEnabled ( ) ) {
124- this . log . writeLine ( `Sending response: ${ JSON . stringify ( response ) } ` )
123+ this . log . writeLine ( `Sending response: ${ JSON . stringify ( response ) } ` ) ;
125124 }
126125 process . send ( response ) ;
127126 if ( this . log . isEnabled ( ) ) {
128- this . log . writeLine ( `Response has been sent.` )
127+ this . log . writeLine ( `Response has been sent.` ) ;
129128 }
130129 }
131130
@@ -134,12 +133,12 @@ namespace ts.server.typingsInstaller {
134133 this . tsdRunCount ++ ;
135134 const tsdPath = combinePaths ( this . npmBinPath , "tsd" ) ;
136135 if ( this . log . isEnabled ( ) ) {
137- this . log . writeLine ( `Running tsd ${ id } , tsd path '${ tsdPath } , typings to install: ${ JSON . stringify ( typingsToInstall ) } . cache path '${ cachePath } '` )
136+ this . log . writeLine ( `Running tsd ${ id } , tsd path '${ tsdPath } , typings to install: ${ JSON . stringify ( typingsToInstall ) } . cache path '${ cachePath } '` ) ;
138137 }
139- this . exec ( `${ tsdPath } install ${ typingsToInstall . join ( " " ) } -ros` , { cwd : cachePath } , ( err , stdout , stderr ) => {
138+ this . exec ( `${ tsdPath } install ${ typingsToInstall . join ( " " ) } -ros` , { cwd : cachePath } , ( err , stdout , stderr ) => {
140139 if ( this . log . isEnabled ( ) ) {
141140 this . log . writeLine ( `TSD ${ id } stdout: ${ stdout } ` ) ;
142- this . log . writeLine ( `TSD ${ id } stderr: ${ stderr } ` )
141+ this . log . writeLine ( `TSD ${ id } stderr: ${ stderr } ` ) ;
143142 }
144143 const i = stdout . indexOf ( "running install" ) ;
145144 if ( i < 0 ) {
@@ -154,7 +153,7 @@ namespace ts.server.typingsInstaller {
154153 installedTypings . push ( match [ 1 ] ) ;
155154 }
156155 postInstallAction ( installedTypings ) ;
157- } )
156+ } ) ;
158157 }
159158 }
160159
0 commit comments