support goto def on /// references with absolute path

This commit is contained in:
Mohamed Hegazy
2014-10-01 16:13:06 -07:00
parent 0434635b94
commit 93e5a94dc8

View File

@@ -2573,7 +2573,8 @@ module ts {
/// Triple slash reference comments
var comment = forEach(sourceFile.referencedFiles, r => (r.pos <= position && position < r.end) ? r : undefined);
if (comment) {
var targetFilename = normalizePath(combinePaths(getDirectoryPath(filename), comment.filename));
var targetFilename = isRootedDiskPath(comment.filename) ? comment.filename : combinePaths(getDirectoryPath(filename), comment.filename);
targetFilename = normalizePath(targetFilename);
if (program.getSourceFile(targetFilename)) {
return [{
fileName: targetFilename,