Skip to content

Commit 8dfc253

Browse files
committed
apply requested changes
1 parent fad05f8 commit 8dfc253

File tree

2 files changed

+7
-42
lines changed

2 files changed

+7
-42
lines changed

src/services/completions.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -875,10 +875,10 @@ namespace ts.Completions {
875875
if (match && reJSDocFragment.lastIndex === jsdocFragment.length) {
876876
return {
877877
kind: match[1]
878-
// The current position is next to the '@' sign, when no tag name being provided yet.
879-
// Provide a full list of tag names
880-
? CompletionDataKind.JsDocTagName:
881-
CompletionDataKind.JsDocTag
878+
// The current position is next to the '@' sign, when no tag name being provided yet.
879+
// Provide a full list of tag names
880+
? CompletionDataKind.JsDocTagName
881+
: CompletionDataKind.JsDocTag
882882
};
883883
}
884884
}
@@ -888,6 +888,9 @@ namespace ts.Completions {
888888
// Completion should work in the brackets
889889
const tag = getJsDocTagAtPosition(currentToken, position);
890890
if (tag) {
891+
if (tag.tagName.pos <= position && position <= tag.tagName.end) {
892+
return { kind: CompletionDataKind.JsDocTagName };
893+
}
891894
if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === SyntaxKind.JSDocTypeExpression) {
892895
currentToken = getTokenAtPosition(sourceFile, position);
893896
if (!currentToken ||

tests/cases/fourslash/completionsJsdocTag.ts

-38
Original file line numberDiff line numberDiff line change
@@ -52,32 +52,6 @@
5252
//// */
5353
////
5454

55-
// 4x - jsdoc tag name completions should not occur
56-
/////**@/*40*/ */
57-
////
58-
/////**
59-
//// *@/*41*/
60-
//// */
61-
////
62-
/////**
63-
//// * @type {@/*42*/
64-
//// */
65-
////
66-
/////**
67-
//// +@/*43*/
68-
//// */
69-
////
70-
/////** some description @/*44*/ */
71-
////
72-
/////**
73-
//// * ### jsdoc @/*45*/
74-
//// */
75-
////
76-
/////**
77-
////@/*46*/
78-
//// */
79-
////
80-
8155
// 5x - jsdoc tag completions should not occur
8256
/////**
8357
//// */*50*/
@@ -121,18 +95,6 @@ test.markerNames().forEach(marker => {
12195
};
12296
break;
12397

124-
// 4x - jsdoc tag name completions should not occur
125-
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
126-
// before the fix, jsdoc tag names was listed but no longer appears
127-
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
128-
case 40: case 41: case 42: case 43: case 44: case 45: case 46:
129-
completionOpt = {
130-
marker,
131-
triggerCharacter: "@",
132-
exact: []
133-
};
134-
break;
135-
13698
// 5x - jsdoc tag completions should not occur
13799
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
138100
// before the fix, jsdoc tags was listed but no longer appears

0 commit comments

Comments
 (0)