mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Always test replacementSpan, and don't provide if it would just be an identifier (#22918)
This commit is contained in:
20 files changed
+152
-258
No files matched your search
@@ -832,7 +832,12 @@ namespace FourSlash {
|
||||
}
|
||||
}
|
||||
|
||||
public verifyCompletionsAt(markerName: string, expected: ReadonlyArray<FourSlashInterface.ExpectedCompletionEntry>, options?: FourSlashInterface.CompletionsAtOptions) {
|
||||
public verifyCompletionsAt(markerName: string | ReadonlyArray<string>, expected: ReadonlyArray<FourSlashInterface.ExpectedCompletionEntry>, options?: FourSlashInterface.CompletionsAtOptions) {
|
||||
if (typeof markerName !== "string") {
|
||||
for (const m of markerName) this.verifyCompletionsAt(m, expected, options);
|
||||
return;
|
||||
}
|
||||
|
||||
this.goToMarker(markerName);
|
||||
|
||||
const actualCompletions = this.getCompletionListAtCaret(options);
|
||||
@@ -3182,9 +3187,7 @@ Actual: ${stringify(fullActual)}`);
|
||||
eq(item.hasAction, hasAction, "hasAction");
|
||||
eq(item.isRecommended, options && options.isRecommended, "isRecommended");
|
||||
eq(item.insertText, options && options.insertText, "insertText");
|
||||
if (options && options.replacementSpan) { // TODO: GH#21679
|
||||
eq(item.replacementSpan, options && options.replacementSpan && ts.createTextSpanFromRange(options.replacementSpan), "replacementSpan");
|
||||
}
|
||||
eq(item.replacementSpan, options && options.replacementSpan && ts.createTextSpanFromRange(options.replacementSpan), "replacementSpan");
|
||||
}
|
||||
|
||||
private findFile(indexOrName: string | number) {
|
||||
@@ -3988,7 +3991,7 @@ namespace FourSlashInterface {
|
||||
super(state);
|
||||
}
|
||||
|
||||
public completionsAt(markerName: string, completions: ReadonlyArray<ExpectedCompletionEntry>, options?: CompletionsAtOptions) {
|
||||
public completionsAt(markerName: string | ReadonlyArray<string>, completions: ReadonlyArray<ExpectedCompletionEntry>, options?: CompletionsAtOptions) {
|
||||
this.state.verifyCompletionsAt(markerName, completions, options);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user