Detecting Class Names / Data Types
I’m trying to make my snippets “smarter”. I want to be able to show methods based off the class and be able to show appropriate methods for a specific data type. Example:
class MainApp {
public static void main(String[] args) {
System.out.println("Hello World!");
int i = 0;
console.log(i.compareTo(Integer));
}
}
For instance, I would like to show methods for System
that are actually available for System
. Also for the variable i
, I would like to show snippets available only to Integer
. Is there any possible way I can check the variable and what type it is, whether it be a class, data type, or some other data structure? It would improve snippets much more if it’s not yet possible. Does anyone know of any way to go about doing this? I assume I would have to analyze the grammar, via a lexical parser. Thanks in advance.