Call Hierarchy for TypeScript

Answered

Hello, 

I am developing a plugin which needs to get the Call Hierarchy of a Typescript method.

I found that CallerMethodsTreeStructure is what I need, however it is only for Java code.

 

My question is that, is there any way for my plugin to get the Call Hierarchy of a Typescript method?

1
11 comments

Hi. There is

JSCallerMethodsTreeStructure

in JavaScript with similar API

1
Avatar
Permanently deleted user

Hello,

Thank you for your reply.

 

I would like to know is there a similar function CopyConcatenatedStringToClipboardIntention that is for JavaScript/TypeScript?

 

0
Avatar
Permanently deleted user

Hi!

Unfortunately, there is no similar intention for JavaScript.

If you'd like to see this intention in the IDE, please vote for https://youtrack.jetbrains.com/issue/WEB-34430.

If you wanted to use the code as part of some larger feature in your plugin, the code would probably be fairly similar. Please let me know if I can help with anything in this case.

1
Avatar
Permanently deleted user

Hello,

Yes, I would like to use it as part of the feature for my plugin.

I will try to figure it out by myself first.

Will let you know if I need your help.

 

Thank you very much!

0
Avatar
Permanently deleted user

Hello, 

I am trying to import the package com.intellij.lang.javascript.psi to my project.

I've added all the jar files in plugins\JavaScriptLanguage\lib folder into the classpath of Intellij IDEA SDK as mentioned here https://intellij-support.jetbrains.com/hc/en-us/community/posts/206756715-com-intellij-lang-javascript-psi-not-exist

 

It shows no error in the Intellij IDEA while writing the code, but it shows the error "error: package com.intellij.lang.javascript.psi does not exist" when I compile the project.

I would like to know is there anything I done wrongly on importing the package?

0

Your SDK setup looks correct. I assume you use builtin Make from IDE? Please try recreating the IJ SDK from scratch.

0
Avatar
Permanently deleted user

Hello,

Do you mean creating a new project from scratch follow this tutorial? https://www.jetbrains.org/intellij/sdk/docs/tutorials/build_system/prerequisites.html

I've done it for a few times, but it still getting the same error message.

I'm sorry but I don't understand what is the "builtin Make from IDE".

0

I meant to recreate the SDK "intelliJ IDEA IU-...." only, not a new project.

"builtin Make from IDE" == Build -> Build Project from main menu vs building the project with Gradle.

0
Avatar
Permanently deleted user

Hello,

I've tried to recreate the SDK, but still the same error occuring.

I did try to add a main method in the class, and run it using the main method. By doing this, it won't show the error package doesn't exist.

But when I try to use run it using the runIde Gradle task, the error will appear again.

0

If you're using Gradle to build your plugin, you'll have to follow the guidelines on adding additional plugins according to Gradle IntelliJ Plugin then, not the Devkit setup way you showed above:

see https://github.com/JetBrains/gradle-intellij-plugin/#setup-dsl "plugins" property

1
Avatar
Permanently deleted user

Thank you very much!

0

Please sign in to leave a comment.