Skip to content

Commit 5e5c5a7

Browse files
authored
Merge pull request #24139 from minestarks/dynamicprojectassert
Normalize ProjectService.currentDirectory
2 parents 982c8d0 + dff5809 commit 5e5c5a7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/server/editorServices.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ namespace ts.server {
403403
/* @internal */
404404
pendingEnsureProjectForOpenFiles: boolean;
405405

406-
readonly currentDirectory: string;
406+
readonly currentDirectory: NormalizedPath;
407407
readonly toCanonicalFileName: (f: string) => string;
408408

409409
public readonly host: ServerHost;
@@ -450,7 +450,7 @@ namespace ts.server {
450450
if (this.host.realpath) {
451451
this.realpathToScriptInfos = createMultiMap();
452452
}
453-
this.currentDirectory = this.host.getCurrentDirectory();
453+
this.currentDirectory = toNormalizedPath(this.host.getCurrentDirectory());
454454
this.toCanonicalFileName = createGetCanonicalFileName(this.host.useCaseSensitiveFileNames);
455455
this.globalCacheLocationDirectoryPath = this.typingsInstaller.globalTypingsCacheLocation &&
456456
ensureTrailingDirectorySeparator(this.toPath(this.typingsInstaller.globalTypingsCacheLocation));

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8176,7 +8176,7 @@ declare namespace ts.server {
81768176
private safelist;
81778177
private legacySafelist;
81788178
private pendingProjectUpdates;
8179-
readonly currentDirectory: string;
8179+
readonly currentDirectory: NormalizedPath;
81808180
readonly toCanonicalFileName: (f: string) => string;
81818181
readonly host: ServerHost;
81828182
readonly logger: Logger;

0 commit comments

Comments
 (0)