-
Couldn't load subscription status.
- Fork 13.1k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: LS: Completion ListsThe issue relates to showing completion lists in an editorThe issue relates to showing completion lists in an editor
Description
Bug Report
🔎 Search Terms
semicolon, class member snippets
🕗 Version & Regression Information
As of 4.5 when class member snippets for completions was enabled
💻 Code
Before completions:
interface Base {
a: number
b(a: string): string
c(a: string): string
c(a: number): number
}
class Sub implements Base {
// Get completions here
}After inserting every class member completion:
interface Base {
a: number
b(a: string): string
c(a: string): string
c(a: number): number
}
class Sub implements Base {
a: number; // << semicolon
b(a: string): string {
}
c(a: string): string; // << semicolon
c(a: number): number; // << semicolon
c(a: any): string | number {
}
}🙁 Actual behavior
When class member completions are offered for property declarations or method signatures (i.e. methods without bodies), they always have a trailing semicolon.
🙂 Expected behavior
No semicolons in the completion text if we determine there shouldn't be any, by means of either:
- preferences says we should remove semicolons (e.g.
SemicolonPreferenceinFormatCodeSettingsis set toRemove), or probablyUsesSemicolons()returns false
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: LS: Completion ListsThe issue relates to showing completion lists in an editorThe issue relates to showing completion lists in an editor