Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 1d75073

Browse files
committed
fix: typeroot resolving on windows
1 parent 5cf7be3 commit 1d75073

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/project-manager.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ export class ProjectManager implements Disposable {
341341
isConfigDependency(filePath: string): boolean {
342342
for (const config of this.configurations()) {
343343
config.ensureConfigFile();
344-
if (config.isExpectedDeclarationFile(toUnixPath(filePath))) {
344+
if (config.isExpectedDeclarationFile(filePath)) {
345345
return true;
346346
}
347347
}
@@ -862,8 +862,9 @@ export class ProjectConfiguration {
862862
this.expectedFilePaths = new Set(configParseResult.fileNames);
863863

864864
const options = configParseResult.options;
865+
const pathResolver = /[a-z]:\//i.test(base) ? path.win32 : path.posix;
865866
this.typeRoots = options.typeRoots ?
866-
options.typeRoots.map((r: string) => path.resolve(this.rootFilePath, r)) :
867+
options.typeRoots.map((r: string) => pathResolver.resolve(this.rootFilePath, r)) :
867868
[];
868869

869870
if (/(^|\/)jsconfig\.json$/.test(this.configFilePath)) {

0 commit comments

Comments
 (0)