Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. COThanks for your answer.Even though in this case it is limited to method scope,in some other cases it might required to search in class/package/project scope. Sorry I'm bit confused on your suggestion. Assume the same code I've given: In the existing visitor I'm using,the visit method of "VariableDeclarationFragment" type gets called when the parser comes to the line where "s" is declared.And I want to find out the references of "s" at that point it self before the existing parser moves forward from the current line.So what you suggest is to use another AST parser at that point? Please explain.
      singulars
    2. COI had originally made the assumption that you knew which variable/field you were looking for. But, if you don't know it yet, then you will need to do two passes over the AST. The first to find the node you are interested in and the second to find references. You will need to also parse and visit all other relevant files in the project, depending on the scope of the variable.
      singulars
    3. COThanks a lot for your explanation. Initially, I also felt that I might have to go for such an approach. But then only I tried things like using the SearchEngine and was looking into the possibilities of using AST it self... etc. since having two AST parsing won't be a better approach in performance aspect. But seems to be that is the only option. May be I should check whether there are any other libraries available to get it done before get into the approach of using two ASTs.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload