Skip to content

Instantly share code, notes, and snippets.

@anstarovoyt
Created August 21, 2020 12:10
Show Gist options
  • Save anstarovoyt/a113927839c4c9d8a4e5c8fd87554f60 to your computer and use it in GitHub Desktop.
Save anstarovoyt/a113927839c4c9d8a4e5c8fd87554f60 to your computer and use it in GitHub Desktop.
def el = __context__;
if (el instanceof com.intellij.lang.javascript.psi.JSReferenceExpression) {
while (true) {
el = el.getParent()
if (el == null) return false
if (el instanceof com.intellij.lang.javascript.psi.JSFunction) {
return __context__.getReferenceName().equals(el.getName())
}
}
}
return false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment