mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Baseline completions and signature help (#43049)
* Initial implementation+first big transitions * about 10 more * Change baseline filename + more baselines 1. Use containing file name instead of first @Filename. 2. Switch the rest of the tests I need for @link over to baselines. * fix lint * Remove unused/incorrectly named fourslash baselines * fix incorrectly updated baselines * dedupe non-unique filenames * Add names to marker baselines Also rename another duped test filename. * Fix semicolon lint
This commit is contained in:
1 parent
f1c911b6c6
commit
5dbb110497
123 files changed
+152267
-2175
No files matched your search
@@ -1917,19 +1917,45 @@ namespace FourSlash {
|
||||
}
|
||||
|
||||
public baselineQuickInfo() {
|
||||
const baselineFile = this.getBaselineFileNameForInternalFourslashFile();
|
||||
Harness.Baseline.runBaseline(
|
||||
baselineFile,
|
||||
stringify(
|
||||
this.testData.markers.map(marker => ({
|
||||
marker,
|
||||
quickInfo: this.languageService.getQuickInfoAtPosition(marker.fileName, marker.position)
|
||||
}))));
|
||||
const baselineFile = this.getBaselineFileNameForContainingTestFile();
|
||||
const result = ts.arrayFrom(this.testData.markerPositions.entries(), ([name, marker]) => ({
|
||||
marker: { ...marker, name },
|
||||
quickInfo: this.languageService.getQuickInfoAtPosition(marker.fileName, marker.position)
|
||||
}));
|
||||
Harness.Baseline.runBaseline(baselineFile, stringify(result));
|
||||
}
|
||||
|
||||
public baselineSignatureHelp() {
|
||||
const baselineFile = this.getBaselineFileNameForContainingTestFile();
|
||||
const result = ts.arrayFrom(this.testData.markerPositions.entries(), ([name, marker]) => ({
|
||||
marker: { ...marker, name },
|
||||
signatureHelp: this.languageService.getSignatureHelpItems(marker.fileName, marker.position, /*options*/ undefined)
|
||||
}));
|
||||
Harness.Baseline.runBaseline(baselineFile, stringify(result));
|
||||
}
|
||||
|
||||
public baselineCompletions(preferences?: ts.UserPreferences) {
|
||||
const baselineFile = this.getBaselineFileNameForContainingTestFile();
|
||||
const result = ts.arrayFrom(this.testData.markerPositions.entries(), ([name, marker]) => {
|
||||
const completions = this.getCompletionListAtCaret(preferences);
|
||||
this.goToMarker(marker);
|
||||
return {
|
||||
marker: { ...marker, name },
|
||||
completionList: {
|
||||
...completions,
|
||||
entries: completions?.entries.map(entry => ({
|
||||
...entry,
|
||||
...this.getCompletionEntryDetails(entry.name, entry.source, entry.data, preferences)
|
||||
})),
|
||||
}
|
||||
};
|
||||
});
|
||||
Harness.Baseline.runBaseline(baselineFile, stringify(result));
|
||||
}
|
||||
|
||||
public baselineSmartSelection() {
|
||||
const n = "\n";
|
||||
const baselineFile = this.getBaselineFileNameForInternalFourslashFile();
|
||||
const baselineFile = this.getBaselineFileNameForContainingTestFile();
|
||||
const markers = this.getMarkers();
|
||||
const fileContent = this.activeFile.content;
|
||||
const text = markers.map(marker => {
|
||||
|
||||
@@ -396,6 +396,14 @@ namespace FourSlashInterface {
|
||||
this.state.baselineQuickInfo();
|
||||
}
|
||||
|
||||
public baselineSignatureHelp() {
|
||||
this.state.baselineSignatureHelp();
|
||||
}
|
||||
|
||||
public baselineCompletions() {
|
||||
this.state.baselineCompletions();
|
||||
}
|
||||
|
||||
public baselineSmartSelection() {
|
||||
this.state.baselineSmartSelection();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user