mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 05:17:43 -05:00
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:
committed by
GitHub
parent
f4e1efbc29
commit
404a7d602d
69
tests/cases/fourslash/completionsOverridingMethod11.ts
Normal file
69
tests/cases/fourslash/completionsOverridingMethod11.ts
Normal 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 {
|
||||
}`,
|
||||
},
|
||||
],
|
||||
});
|
||||
Reference in New Issue
Block a user