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

Fix preloading of files from code fixes on Windows #377

Merged
merged 3 commits into from
Oct 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/typescript-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,13 @@ export class TypeScriptService {

return this.projectManager.ensureOwnFiles(span)
.concat(Observable.defer(() => {
const configuration = this.projectManager.getConfiguration(fileTextChanges[0].fileName)
// Configuration lookup uses Windows paths, FileTextChanges uses unix paths. Convert to backslashes.
const unixFilePath = fileTextChanges[0].fileName
const firstChangedFile = /^[a-z]:\//i.test(unixFilePath) ?
unixFilePath.replace(/\//g, '\\') :
unixFilePath

const configuration = this.projectManager.getConfiguration(firstChangedFile)
configuration.ensureBasicFiles(span)

const changes: {[uri: string]: TextEdit[]} = {}
Expand Down