Skip to content

Commit b5b816a

Browse files
committed
fix(filter-jsx-suggestions): local React FC declared with function declaration (named function) were not displayed in the suggestions listed
1 parent 0531e41 commit b5b816a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

typescript/src/completions/filterJsxComponents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default (entries: ts.CompletionEntry[], node: ts.Node, position: number,
7676
let shouldBeCached = firstDeclarationFileName.includes('node_modules')
7777
if (!shouldBeCached && firstDeclaration.getSourceFile().fileName === fileName) {
7878
// startMark()
79-
const definitionAtPosition = languageService.getDefinitionAtPosition(fileName, firstDeclaration.pos + 1)?.[0]
79+
const definitionAtPosition = languageService.getDefinitionAtPosition(fileName, firstDeclaration.pos + firstDeclaration.getLeadingTriviaWidth())?.[0]
8080
// addMark('getDefinitionAtPosition')
8181
if (!definitionAtPosition) return
8282
shouldBeCached = definitionAtPosition.fileName.includes('node_modules')

0 commit comments

Comments
 (0)