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

@@ -0,0 +1,69 @@
/// <reference path="fourslash.ts" />
// @Filename: a.ts
// @newline: LF
// Case: formatting: no semicolons
////function foo() {
//// const a = 1
//// const b = 2
//// foo()
//// return a + b
////}
////
////interface Base {
//// a: string
//// b(a: string): void
//// c(a: string): string
//// c(a: number): number
////}
////class Sub implements Base {
//// /*a*/
////}
verify.completions({
marker: "a",
isNewIdentifierLocation: true,
preferences: {
includeCompletionsWithInsertText: true,
includeCompletionsWithSnippetText: false,
includeCompletionsWithClassMemberSnippets: true,
},
includes: [
{
name: "a",
sortText: completion.SortText.LocationPriority,
replacementSpan: {
fileName: "",
pos: 0,
end: 0,
},
insertText: "a: string",
},
{
name: "b",
sortText: completion.SortText.LocationPriority,
replacementSpan: {
fileName: "",
pos: 0,
end: 0,
},
insertText:
`b(a: string): void {
}`,
},
{
name: "c",
sortText: completion.SortText.LocationPriority,
replacementSpan: {
fileName: "",
pos: 0,
end: 0,
},
insertText:
`c(a: string): string
c(a: number): number
c(a: any): string | number {
}`,
},
],
});