Skip to content

Commit 0f1a628

Browse files
committed
chore: update for target
1 parent 81b9ae7 commit 0f1a628

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

webstorm/src/main/kotlin/cc/unitmesh/ide/webstorm/provider/JavaScriptLivingDocumentation.kt

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,28 +35,7 @@ class JavaScriptLivingDocumentation : LivingDocumentation {
3535
}
3636

3737
override fun findNearestDocumentationTarget(psiElement: PsiElement): PsiNameIdentifierOwner? {
38-
var candidate: PsiElement? = null
39-
40-
// lookup
41-
if (psiElement is PsiWhiteSpace) {
42-
val parent = psiElement.parent
43-
when (parent) {
44-
is JSFile, is JSEmbeddedContent, is JSObjectLiteralExpression, is JSBlockStatement, is TypeScriptObjectType -> {
45-
candidate = PsiTreeUtil.skipWhitespacesAndCommentsForward(psiElement)
46-
}
47-
is JSClass -> {
48-
val next = PsiTreeUtil.skipWhitespacesAndCommentsForward(psiElement)
49-
if (JSUtils.isMember(next)) {
50-
candidate = next
51-
}
52-
}
53-
}
54-
}
55-
56-
// find to parent
57-
if (candidate == null) {
58-
candidate = psiElement.parentOfTypes(PsiNameIdentifierOwner::class, JSSourceElement::class)
59-
}
38+
var candidate: PsiElement? = psiElement.parentOfTypes(PsiNameIdentifierOwner::class, JSSourceElement::class)
6039

6140
if (candidate is JSParameter) {
6241
candidate = candidate.declaringFunction

0 commit comments

Comments
 (0)