From da51f396955ffa416e37e985fc33f4cf35aebfe6 Mon Sep 17 00:00:00 2001 From: Yui T Date: Wed, 1 Mar 2017 21:11:34 -0800 Subject: [PATCH] FIx minor stuffs --- src/services/completions.ts | 4 ++-- tests/cases/fourslash/completionInJsDoc.ts | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/services/completions.ts b/src/services/completions.ts index 042312c1240..6a4ee3485de 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -59,7 +59,7 @@ namespace ts.Completions { } // Add keywords if this is not a member completion list - if (!isMemberCompletion && !(requestJsDocTag && requestJsDocTagName)) { + if (!isMemberCompletion && !requestJsDocTag && !requestJsDocTagName) { addRange(entries, keywordCompletions); } @@ -858,7 +858,7 @@ namespace ts.Completions { // * |c| // */ const lineStart = getLineStartPositionForPosition(position, sourceFile); - requestJsDocTag = !(sourceFile.text.substr(lineStart, position).match(/[^\*|\s|(/\*\*)]/)); + requestJsDocTag = !(sourceFile.text.substring(lineStart, position).match(/[^\*|\s|(/\*\*)]/)); } } diff --git a/tests/cases/fourslash/completionInJsDoc.ts b/tests/cases/fourslash/completionInJsDoc.ts index 3fd92f42d52..60707905956 100644 --- a/tests/cases/fourslash/completionInJsDoc.ts +++ b/tests/cases/fourslash/completionInJsDoc.ts @@ -35,22 +35,24 @@ //// /** //// * /*11*/ //// */ - +//// //// /** //// /*12*/ //// */ - +//// //// /** //// * /*13*/ //// */ - +//// //// /** //// * some comment /*14*/ //// */ - +//// //// /** //// * @param /*15*/ //// */ +//// +//// /** @param /*16*/ */ goTo.marker('1'); verify.completionListContains("constructor"); @@ -105,4 +107,7 @@ goTo.marker('14'); verify.completionListIsEmpty(); goTo.marker('15'); +verify.completionListIsEmpty(); + +goTo.marker('16'); verify.completionListIsEmpty(); \ No newline at end of file