diff --git a/src/services/completions.ts b/src/services/completions.ts index ba5d150307519..b710aa8cd78bb 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -1590,7 +1590,9 @@ namespace ts.Completions { if (m.kind !== SyntaxKind.PropertyAssignment && m.kind !== SyntaxKind.ShorthandPropertyAssignment && m.kind !== SyntaxKind.BindingElement && - m.kind !== SyntaxKind.MethodDeclaration) { + m.kind !== SyntaxKind.MethodDeclaration && + m.kind !== SyntaxKind.GetAccessor && + m.kind !== SyntaxKind.SetAccessor) { continue; } diff --git a/tests/cases/fourslash/server/completions03.ts b/tests/cases/fourslash/server/completions03.ts new file mode 100644 index 0000000000000..ef5f165195126 --- /dev/null +++ b/tests/cases/fourslash/server/completions03.ts @@ -0,0 +1,20 @@ +/// + +// issue: https://github.com/Microsoft/TypeScript/issues/10108 + +//// interface Foo { +//// one: any; +//// two: any; +//// three: any; +//// } +//// +//// let x: Foo = { +//// get one() { return "" }, +//// set two(t) {}, +//// /**/ +//// } + +goTo.marker(""); +verify.completionListContains("three"); +verify.not.completionListContains("one"); +verify.not.completionListContains("two");