Skip to content

Commit

Permalink
apply requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffy-g committed May 11, 2020
1 parent 8c58df3 commit fe460f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 42 deletions.
11 changes: 7 additions & 4 deletions src/services/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -875,10 +875,10 @@ namespace ts.Completions {
if (match && reJSDocFragment.lastIndex === jsdocFragment.length) {
return {
kind: match[1]
// The current position is next to the '@' sign, when no tag name being provided yet.
// Provide a full list of tag names
? CompletionDataKind.JsDocTagName:
CompletionDataKind.JsDocTag
// The current position is next to the '@' sign, when no tag name being provided yet.
// Provide a full list of tag names
? CompletionDataKind.JsDocTagName
: CompletionDataKind.JsDocTag
};
}
}
Expand All @@ -888,6 +888,9 @@ namespace ts.Completions {
// Completion should work in the brackets
const tag = getJsDocTagAtPosition(currentToken, position);
if (tag) {
if (tag.tagName.pos <= position && position <= tag.tagName.end) {
return { kind: CompletionDataKind.JsDocTagName };
}
if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === SyntaxKind.JSDocTypeExpression) {
currentToken = getTokenAtPosition(sourceFile, position);
if (!currentToken ||
Expand Down
38 changes: 0 additions & 38 deletions tests/cases/fourslash/completionsJsdocTag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,32 +52,6 @@
//// */
////

// 4x - jsdoc tag name completions should not occur
/////**@/*40*/ */
////
/////**
//// *@/*41*/
//// */
////
/////**
//// * @type {@/*42*/
//// */
////
/////**
//// +@/*43*/
//// */
////
/////** some description @/*44*/ */
////
/////**
//// * ### jsdoc @/*45*/
//// */
////
/////**
////@/*46*/
//// */
////

// 5x - jsdoc tag completions should not occur
/////**
//// */*50*/
Expand Down Expand Up @@ -121,18 +95,6 @@ test.markerNames().forEach(marker => {
};
break;

// 4x - jsdoc tag name completions should not occur
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// before the fix, jsdoc tag names was listed but no longer appears
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
case 40: case 41: case 42: case 43: case 44: case 45: case 46:
completionOpt = {
marker,
triggerCharacter: "@",
exact: []
};
break;

// 5x - jsdoc tag completions should not occur
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// before the fix, jsdoc tags was listed but no longer appears
Expand Down

0 comments on commit fe460f0

Please sign in to comment.