generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(javascript): consolidate type resolution logic into JSTypeRe…
…solver Moved type resolution logic from `JSAutoTestingService` and `JSRelevantUtil` into a new `JSTypeResolver` utility class. Added `JavaScriptRelatedClassesProvider` for TypeScript support and updated `JSPsiContextVariableProvider` to use the new resolver. Deleted the now redundant `JSRelevantUtil` file.
- Loading branch information
Showing
5 changed files
with
36 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
.../main/kotlin/com/phodal/shirelang/javascript/provider/JavaScriptRelatedClassesProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.phodal.shirelang.javascript.provider | ||
|
||
import com.intellij.psi.PsiElement | ||
import com.intellij.psi.PsiFile | ||
import com.phodal.shirecore.provider.psi.RelatedClassesProvider | ||
import com.phodal.shirelang.javascript.JSTypeResolver | ||
|
||
class JavaScriptRelatedClassesProvider : RelatedClassesProvider { | ||
override fun lookup(element: PsiElement): List<PsiElement> { | ||
return JSTypeResolver.resolveByElement(element) | ||
} | ||
|
||
override fun lookup(element: PsiFile): List<PsiElement> { | ||
return JSTypeResolver.resolveByElement(element) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters