@@ -83,6 +83,7 @@ namespace ts.server.typingsInstaller {
8383 private safeList : JsTyping . SafeList | undefined ;
8484 readonly pendingRunRequests : PendingRequest [ ] = [ ] ;
8585 private readonly toCanonicalFileName : GetCanonicalFileName ;
86+ private readonly globalCacheCanonicalPackageJsonPath : string ;
8687
8788 private installRunCount = 1 ;
8889 private inFlightRequestCount = 0 ;
@@ -97,6 +98,7 @@ namespace ts.server.typingsInstaller {
9798 private readonly throttleLimit : number ,
9899 protected readonly log = nullLog ) {
99100 this . toCanonicalFileName = createGetCanonicalFileName ( installTypingHost . useCaseSensitiveFileNames ) ;
101+ this . globalCacheCanonicalPackageJsonPath = combinePaths ( this . toCanonicalFileName ( globalCachePath ) , "package.json" ) ;
100102 if ( this . log . isEnabled ( ) ) {
101103 this . log . writeLine ( `Global cache location '${ globalCachePath } ', safe file path '${ safeListPath } ', types map path ${ typesMapLocation } ` ) ;
102104 }
@@ -440,7 +442,7 @@ namespace ts.server.typingsInstaller {
440442 return ;
441443 }
442444 f = this . toCanonicalFileName ( f ) ;
443- if ( isPackageOrBowerJson ( f ) && f !== this . toCanonicalFileName ( combinePaths ( this . globalCachePath , "package.json" ) ) ) {
445+ if ( f !== this . globalCacheCanonicalPackageJsonPath && isPackageOrBowerJson ( f ) ) {
444446 watchers . isInvoked = true ;
445447 this . sendResponse ( { projectName, kind : ActionInvalidate } ) ;
446448 }
0 commit comments