From b38d7ac9fd41c46b70c0e5fcfe815a25c98270a4 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Mon, 26 Sep 2016 11:19:06 -0700 Subject: [PATCH] Annotate directorySeparator --- src/compiler/core.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 72d05e1cfd7..aca9701eee7 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1044,9 +1044,14 @@ namespace ts { return 0; } + /** + * Internally, we represent paths as strings with '/' as the directory separator. + * When we make system calls (eg: LanguageServiceHost.getDirectory()), + * we expect the host to correctly handle paths in our specified format. + */ export const directorySeparator = "/"; const directorySeparatorCharCode = CharacterCodes.slash; - function getNormalizedParts(normalizedSlashedPath: string, rootLength: number) { + function getNormalizedParts(normalizedSlashedPath: string, rootLength: number): string[] { const parts = normalizedSlashedPath.substr(rootLength).split(directorySeparator); const normalized: string[] = []; for (const part of parts) {