Skip to content

Commit 432da93

Browse files
committed
Add doc comments for fileExists and directoryExists implementation
1 parent b26ca16 commit 432da93

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/server/project.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,6 +1549,11 @@ namespace ts.server {
15491549
useSourceOfProjectReferenceRedirect = () => !!this.languageServiceEnabled &&
15501550
!this.getCompilerOptions().disableSourceOfProjectReferenceRedirect;
15511551

1552+
/**
1553+
* This implementation of fileExists checks if the file being requested is
1554+
* .d.ts file for the referenced Project.
1555+
* If it is it returns true irrespective of whether that file exists on host
1556+
*/
15521557
fileExists(file: string): boolean {
15531558
// Project references go to source file instead of .d.ts file
15541559
if (this.useSourceOfProjectReferenceRedirect() && this.projectReferenceCallbacks) {
@@ -1558,6 +1563,11 @@ namespace ts.server {
15581563
return super.fileExists(file);
15591564
}
15601565

1566+
/**
1567+
* This implementation of directoryExists checks if the directory being requested is
1568+
* directory of .d.ts file for the referenced Project.
1569+
* If it is it returns true irrespective of whether that directory exists on host
1570+
*/
15611571
directoryExists(path: string): boolean {
15621572
if (super.directoryExists(path)) return true;
15631573
if (!this.useSourceOfProjectReferenceRedirect() || !this.projectReferenceCallbacks) return false;

tests/baselines/reference/api/tsserverlibrary.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8576,7 +8576,17 @@ declare namespace ts.server {
85768576
private projectErrors;
85778577
private projectReferences;
85788578
protected isInitialLoadPending: () => boolean;
8579+
/**
8580+
* This implementation of fileExists checks if the file being requested is
8581+
* .d.ts file for the referenced Project.
8582+
* If it is it returns true irrespective of whether that file exists on host
8583+
*/
85798584
fileExists(file: string): boolean;
8585+
/**
8586+
* This implementation of directoryExists checks if the directory being requested is
8587+
* directory of .d.ts file for the referenced Project.
8588+
* If it is it returns true irrespective of whether that directory exists on host
8589+
*/
85808590
directoryExists(path: string): boolean;
85818591
/**
85828592
* If the project has reload from disk pending, it reloads (and then updates graph as part of that) instead of just updating the graph

0 commit comments

Comments
 (0)