i am writing a plugin, where the user is selecting some code (within a method for example) and i run some analyzer on top of the selected code.
What iam currently doing is creating a codeblock from the selected text and then i run some walker over it (because the selected text could be over multiple expressions)
The problem i have is that references going outside this textblock are obv. not correctly resolved, so currently i try to search for the "right" references in the main psi file. this is slow and taking a long time to program,
I wonder if its possible to take a psi file, and let the JavaRecursiveElementVisitor only run over a small portion (via offsets for example) of a main psi file