Skip to content
This repository has been archived by the owner on Jun 27, 2018. It is now read-only.

fix(reference) support reference import lookup #19

Merged
merged 2 commits into from
Apr 16, 2015
Merged
Changes from 1 commit
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
Next Next commit
fix(reference) support reference import lookup
refs #15
  • Loading branch information
basarat committed Apr 16, 2015
commit 7596b336b4abc3a5d9cf2d6ffafd794466593809
22 changes: 16 additions & 6 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,22 @@ module tss {
getScriptVersion: (fileName) => this.files[fileName] && this.files[fileName].version.toString(),
getScriptSnapshot: (fileName) => {
var file = this.files[fileName];
return {
getText: (start, end) => file.text.substring(start, end),
getLength: () => file.text.length,
getLineStartPositions: () => [],
getChangeRange: (oldSnapshot) => undefined
};
if (file) {
return {
getText: (start, end) => file.text.substring(start, end),
getLength: () => file.text.length,
getLineStartPositions: (): number[]=> [],
getChangeRange: (oldSnapshot) => undefined
};
}
else { // This is some reference import
return {
getText: (start, end) => '',
getLength: () => 0,
getLineStartPositions: (): number[]=> [],
getChangeRange: (oldSnapshot) => undefined
};
}
},
getCurrentDirectory: () => process.cwd(),
getScriptIsOpen: () => true,
Expand Down