How can I get the import python file in Idea Puligin

Answered

1. my input is  :PsiFile file

2. Plugin run in pycharm :show the class is   com.jetbrains.python.psi.impl.PyFileImpl

3. Todo:  hao get the import file by  file

for (PsiElement element : file.getChildren()) {
        if (element instanceof PsiImportStatement) {}

}

error : java.lang.NoClassDefFoundError: com/intellij/psi/PsiImportStatement

 

0
1 comment

For questions and problems related to plugin development, please use the following channels:

JetBrains Platform Slack: #intellij-platform. Here you can ask questions about extending JetBrains products, with answers coming from both JetBrains team members and members of the community.

Official Plugin Development forum: regularly updated with answers by JetBrains team members.


For more information, see https://plugins.jetbrains.com/docs/intellij/getting-help.html.

1

Please sign in to leave a comment.