diff --git a/src/services/services.ts b/src/services/services.ts index c59fb53282e..b82a26c8039 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -4497,7 +4497,9 @@ namespace ts { return undefined; } - if (node.parent.kind === SyntaxKind.PropertyAssignment && node.parent.parent.kind === SyntaxKind.ObjectLiteralExpression) { + if (node.parent.kind === SyntaxKind.PropertyAssignment && + node.parent.parent.kind === SyntaxKind.ObjectLiteralExpression && + (node.parent).name === node) { // Get quoted name of properties of the object literal expression // i.e. interface ConfigFiles { // 'jspm:dev': string diff --git a/tests/cases/fourslash/completionListInObjectLiteralPropertyAssignment.ts b/tests/cases/fourslash/completionListInObjectLiteralPropertyAssignment.ts new file mode 100644 index 00000000000..14ccd985577 --- /dev/null +++ b/tests/cases/fourslash/completionListInObjectLiteralPropertyAssignment.ts @@ -0,0 +1,15 @@ +/// + +////var foo; +////interface I { +//// metadata: string; +//// wat: string; +////} +////var x: I = { +//// metadata: "/*1*/ +////} + +goTo.marker('1'); + +verify.not.completionListContains("metadata"); +verify.not.completionListContains("wat"); \ No newline at end of file