use of meghanada.docs.declaration.DeclarationSearcher in project meghanada-server by mopemope.
the class Session method showDeclaration.
public Optional<Declaration> showDeclaration(final String path, final int line, final int column, final String symbol) throws IOException, ExecutionException {
boolean b = this.changeProject(path);
final DeclarationSearcher searcher = this.getDeclarationSearcher();
return searcher.searchDeclaration(new File(path), line, column, symbol);
}
use of meghanada.docs.declaration.DeclarationSearcher in project meghanada-server by mopemope.
the class JavaAnalyzerTest method analyze04.
@Test
public void analyze04() throws Exception {
final JavaAnalyzer analyzer = getAnalyzer();
final String cp = getClasspath();
List<File> files = new ArrayList<>();
final File file = new File("./src/test/java/meghanada/Gen4.java").getCanonicalFile();
assertTrue(file.exists());
files.add(file);
final String tmp = System.getProperty("java.io.tmpdir");
timeIt(() -> {
final CompileResult compileResult = analyzer.analyzeAndCompile(files, cp, tmp);
compileResult.getSources().values().forEach(Source::dump);
return compileResult;
});
timeIt(() -> {
return analyzer.analyzeAndCompile(files, cp, tmp);
});
final DeclarationSearcher searcher = new DeclarationSearcher(getProject());
final Optional<Declaration> declaration = searcher.searchDeclaration(file, 9, 22, "value");
assertNotNull(declaration);
}
Aggregations