use of org.eclipse.lsp4j.TypeDefinitionParams in project eclipse.jdt.ls by eclipse.
the class SyntaxServerTest method testTypeDefinition.
@Test
public void testTypeDefinition() throws Exception {
URI fileURI = openFile("maven/salut4", "src/main/java/java/Foo.java");
TextDocumentIdentifier identifier = new TextDocumentIdentifier(fileURI.toString());
TypeDefinitionParams params = new TypeDefinitionParams(identifier, new Position(11, 24));
Either<List<? extends Location>, List<? extends LocationLink>> result = server.typeDefinition(params).join();
assertTrue(result.isLeft());
assertNotNull(result.getLeft());
assertEquals(1, result.getLeft().size());
String targetUri = result.getLeft().get(0).getUri();
assertNotNull(targetUri);
assertEquals(ResourceUtils.toClientUri(getFileUri("maven/salut4", "src/main/java/java/Bar.java")), targetUri);
}
Aggregations