Skip to content

Commit eef71f8

Browse files
committed
fix: Expand logic to include type elements in JSDoc
1 parent 56ace39 commit eef71f8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/astnav/tokens.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func getTokenAtPosition(
190190
flags := scanner.TokenFlags()
191191
if tokenStart <= position && (position < tokenEnd) {
192192
if token == ast.KindIdentifier || !ast.IsTokenKind(token) {
193-
if ast.IsJSDocKind(current.Kind) {
193+
if ast.IsJSDocKind(current.Kind) || ast.IsTypeElement(current) {
194194
return current
195195
}
196196
panic(fmt.Sprintf("did not expect %s to have %s in its trivia", current.Kind.String(), token.String()))

internal/fourslash/tests/completionsJsdocStringProperty_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var someVariable;`
2626
f.VerifyCompletions(t, nil, &fourslash.CompletionsExpectedList{
2727
IsIncomplete: false,
2828
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
29-
CommitCharacters: &[]string{},
29+
CommitCharacters: &[]string{".", ",", ";"},
3030
EditRange: Ignored,
3131
},
3232
Items: &fourslash.CompletionsExpectedItems{},

0 commit comments

Comments
 (0)