Skip to content

Commit 40e0fc7

Browse files
committed
Fix microsoft#10108 (Completion suggestion for object literal with getter)
1 parent cef9d85 commit 40e0fc7

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/services/completions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,8 @@ namespace ts.Completions {
15901590
if (m.kind !== SyntaxKind.PropertyAssignment &&
15911591
m.kind !== SyntaxKind.ShorthandPropertyAssignment &&
15921592
m.kind !== SyntaxKind.BindingElement &&
1593-
m.kind !== SyntaxKind.MethodDeclaration) {
1593+
m.kind !== SyntaxKind.MethodDeclaration &&
1594+
m.kind !== SyntaxKind.GetAccessor) {
15941595
continue;
15951596
}
15961597

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/// <reference path="../fourslash.ts"/>
2+
3+
// issue: https://github.com/Microsoft/TypeScript/issues/10108
4+
5+
//// interface Foo {
6+
//// one: any;
7+
//// two: any;
8+
//// }
9+
////
10+
//// let x: Foo = {
11+
//// get one() { return "" },
12+
//// /**/
13+
//// }
14+
15+
goTo.marker("");
16+
verify.completionListContains("two");
17+
verify.not.completionListContains("one");

0 commit comments

Comments
 (0)