get information from method invocation

hi,

   there are codes below:

   public static final String JET_BRAINS = "JetBrains";

    public String getText() {
        return "Hello";
    }

    public void test(List<String> texts) {
        texts.add("Mr");
        texts.add(new String("Intellij"));
        /*texts.add(getText());*/
        texts.add(JET_BRAINS);
    }


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 ?

0

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.

0

ok, thank you for your answer


0

请先登录再写评论。