Gabritto/semicolons (#46832)

* call formatter in completions

* fixes

* add test

* update api baselines

* fix createModifiersFromModifierFlag to not return empty array
This commit is contained in:
Gabriela Araujo Britto
2022-01-04 11:50:49 -08:00
committed by GitHub
parent f4e1efbc29
commit 404a7d602d
17 changed files with 209 additions and 77 deletions

View File

@@ -1348,7 +1348,11 @@ namespace FourSlash {
if (options) {
this.configure(options);
}
return this.languageService.getCompletionsAtPosition(this.activeFile.fileName, this.currentCaretPosition, options);
return this.languageService.getCompletionsAtPosition(
this.activeFile.fileName,
this.currentCaretPosition,
options,
this.formatCodeSettings);
}
private getCompletionEntryDetails(entryName: string, source: string | undefined, data: ts.CompletionEntryData | undefined, preferences?: ts.UserPreferences): ts.CompletionEntryDetails | undefined {

View File

@@ -472,8 +472,8 @@ namespace Harness.LanguageService {
const responseFormat = format || ts.SemanticClassificationFormat.Original;
return unwrapJSONCallResult(this.shim.getEncodedSemanticClassifications(fileName, span.start, span.length, responseFormat));
}
getCompletionsAtPosition(fileName: string, position: number, preferences: ts.UserPreferences | undefined): ts.CompletionInfo {
return unwrapJSONCallResult(this.shim.getCompletionsAtPosition(fileName, position, preferences));
getCompletionsAtPosition(fileName: string, position: number, preferences: ts.UserPreferences | undefined, formattingSettings: ts.FormatCodeSettings | undefined): ts.CompletionInfo {
return unwrapJSONCallResult(this.shim.getCompletionsAtPosition(fileName, position, preferences, formattingSettings));
}
getCompletionEntryDetails(fileName: string, position: number, entryName: string, formatOptions: ts.FormatCodeOptions | undefined, source: string | undefined, preferences: ts.UserPreferences | undefined, data: ts.CompletionEntryData | undefined): ts.CompletionEntryDetails {
return unwrapJSONCallResult(this.shim.getCompletionEntryDetails(fileName, position, entryName, JSON.stringify(formatOptions), source, preferences, data));