get information from method invocation


   there are codes below:

   public static final String JET_BRAINS = "JetBrains";

    public String getText() {
        return "Hello";

    public void test(List<String> texts) {
        texts.add(new String("Intellij"));

is there any way to know that the "texts" PsiParameter contains the following strings when the "test" method is invoked: "Mr", "Intellij", "Hello", "JetBrains",

i know this is a runtime situation, but any good idea for this purpose ?

Comment actions Permalink

There is no existing API that will return this for you automatically. You need to analyze the PSI tree, resolve the method calls and look at the parameters and results.

Comment actions Permalink

ok, thank you for your answer


Please sign in to leave a comment.