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

Commit 1c4fe3a

Browse files
tomv564felixfbecker
authored andcommitted
fix(codefix): preloading of files from code fixes on Windows (#377)
Use uri2path to get windows path out of TS's normalized path
1 parent 2391d4a commit 1c4fe3a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/typescript-service.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1245,7 +1245,13 @@ export class TypeScriptService {
12451245

12461246
return this.projectManager.ensureOwnFiles(span)
12471247
.concat(Observable.defer(() => {
1248-
const configuration = this.projectManager.getConfiguration(fileTextChanges[0].fileName)
1248+
// Configuration lookup uses Windows paths, FileTextChanges uses unix paths. Convert to backslashes.
1249+
const unixFilePath = fileTextChanges[0].fileName
1250+
const firstChangedFile = /^[a-z]:\//i.test(unixFilePath) ?
1251+
unixFilePath.replace(/\//g, '\\') :
1252+
unixFilePath
1253+
1254+
const configuration = this.projectManager.getConfiguration(firstChangedFile)
12491255
configuration.ensureBasicFiles(span)
12501256

12511257
const changes: {[uri: string]: TextEdit[]} = {}

0 commit comments

Comments
 (0)