Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
apply requested changes
  • Loading branch information
jeffy-g committed May 11, 2020
commit fe460f0a899e32bc848c2c28072ef15ef504fe8e
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