Renamed span to textSpan to better follow other language service APIs

This commit is contained in:
Richard Knoll
2016-08-03 11:07:57 -07:00
parent 8b5a3d9fd7
commit 293ca60ffd
3 changed files with 10 additions and 10 deletions
+3 -3
View File
@@ -779,10 +779,10 @@ namespace FourSlash {
if (ranges && ranges.length > rangeIndex) {
const range = ranges[rangeIndex];
const start = completions.span.start;
const end = start + completions.span.length;
const start = completions.textSpan.start;
const end = start + completions.textSpan.length;
if (range.start !== start || range.end !== end) {
this.raiseError(`Expected completion span for '${symbol}', ${stringify(completions.span)}, to cover range ${stringify(range)}`);
this.raiseError(`Expected completion span for '${symbol}', ${stringify(completions.textSpan)}, to cover range ${stringify(range)}`);
}
}
else {
+1 -1
View File
@@ -236,7 +236,7 @@ namespace ts.server {
const endPosition = this.lineOffsetToPosition(fileName, response.span.end);
return {
span: ts.createTextSpanFromBounds(startPosition, endPosition),
textSpan: ts.createTextSpanFromBounds(startPosition, endPosition),
entries: response.body
};
}
+6 -6
View File
@@ -1482,7 +1482,7 @@ namespace ts {
}
export interface ImportCompletionInfo {
span: TextSpan;
textSpan: TextSpan;
entries: ImportCompletionEntry[];
}
@@ -4513,7 +4513,7 @@ namespace ts {
// Get all known external module names or complete a path to a module
return {
entries: getStringLiteralCompletionEntriesFromModuleNames(<StringLiteral>node),
span: getDirectoryFragmentTextSpan((<StringLiteral>node).text, node.getStart() + 1)
textSpan: getDirectoryFragmentTextSpan((<StringLiteral>node).text, node.getStart() + 1)
};
}
}
@@ -4793,18 +4793,18 @@ namespace ts {
const scriptPath = getDirectoryPath(sourceFile.path);
if (kind === "path") {
// Give completions for a relative path
const span: TextSpan = getDirectoryFragmentTextSpan(toComplete, range.pos + prefix.length);
const textSpan: TextSpan = getDirectoryFragmentTextSpan(toComplete, range.pos + prefix.length);
return {
entries: getCompletionEntriesForDirectoryFragment(toComplete, scriptPath, getSupportedExtensions(program.getCompilerOptions()), /*includeExtensions*/true, sourceFile.path),
span
textSpan
};
}
else {
// Give completions based on the typings available
const span: TextSpan = { start: range.pos + prefix.length, length: match[0].length - prefix.length };
const textSpan: TextSpan = { start: range.pos + prefix.length, length: match[0].length - prefix.length };
return {
entries: getCompletionEntriesFromTypings(host, program.getCompilerOptions(), scriptPath),
span
textSpan
};
}
}