PSI Elements: How to deal with them (e.g. get name Value)?

Hello,

Unfortunately I can't figure it out (after some researches) how to get the value of the property "name" of a PSI Element.
I´m using the PsiViewer to get the view of the current PSI file but duo my lack of knowledge with the developing of custom language I can´t imagine how to write the correct code or using the right methods.

My goal is it to create a feature in an existing custom language plugin, which is able to search unused "keywords" over a ActionPerfom button and show them all in a JList (by using ToolWindow from intelliJ).

Now the questions are, is it possible to iterate/navigate over a PSI file (in seperate nodes) and get the specific PSI elements (children) into possible lists or arrays? And is it possible to extract their property name value as a String type into a list/array?

I would look forward to a positive response and thanks in advance!

0

Please sign in to leave a comment.