Merge pull request #11401 from Microsoft/completionInObjectLiteralAssignment

Fix incorrect returning of completion entries when in string literal of property assignment expression
This commit is contained in:
Sheetal Nandi 2016-10-05 17:02:58 -07:00 committed by GitHub
commit 2f5e7142cb
2 changed files with 18 additions and 1 deletions

View File

@ -138,7 +138,9 @@ namespace ts.Completions {
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 &&
(<PropertyAssignment>node.parent).name === node) {
// Get quoted name of properties of the object literal expression
// i.e. interface ConfigFiles {
// 'jspm:dev': string

View File

@ -0,0 +1,15 @@
/// <reference path='fourslash.ts' />
////var foo;
////interface I {
//// metadata: string;
//// wat: string;
////}
////var x: I = {
//// metadata: "/*1*/
////}
goTo.marker('1');
verify.not.completionListContains("metadata");
verify.not.completionListContains("wat");