PT #165911996: Switch to LocationLink from Location for definitions
This commit is contained in:
@@ -20,6 +20,7 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.lsp4j.DidChangeConfigurationParams;
|
||||
import org.eclipse.lsp4j.Location;
|
||||
import org.eclipse.lsp4j.LocationLink;
|
||||
import org.eclipse.lsp4j.Position;
|
||||
import org.eclipse.lsp4j.Range;
|
||||
import org.junit.Before;
|
||||
@@ -95,7 +96,7 @@ public class XmlBeansHyperlinkTest {
|
||||
"</beans>\n",
|
||||
UriUtil.toUri(xmlFilePath.toFile()).toString()
|
||||
);
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "u.t.r.SimpleObj", project, "u.t.r.SimpleObj");
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "u.t.r.SimpleObj", project, editor.rangeOf("u.t.r.SimpleObj", "u.t.r.SimpleObj"), "u.t.r.SimpleObj");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -113,7 +114,9 @@ public class XmlBeansHyperlinkTest {
|
||||
"</beans>\n",
|
||||
UriUtil.toUri(xmlFilePath.toFile()).toString()
|
||||
);
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "age", project, DefinitionLinkAsserts.method("u.t.r.TestBean", "setAge", "int"));
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "age", project,
|
||||
editor.rangeOf("<property name=\"age\" value=\"10\" />", "age"),
|
||||
DefinitionLinkAsserts.method("u.t.r.TestBean", "setAge", "int"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -131,7 +134,9 @@ public class XmlBeansHyperlinkTest {
|
||||
"</beans>\n",
|
||||
UriUtil.toUri(xmlFilePath.toFile()).toString()
|
||||
);
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "message", project, DefinitionLinkAsserts.method("u.t.r.SuperTestBean", "setMessage", "java.lang.String"));
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "message", project,
|
||||
editor.rangeOf("<property name=\"message\" value=\"Hello\" />", "message"),
|
||||
DefinitionLinkAsserts.method("u.t.r.SuperTestBean", "setMessage", "java.lang.String"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -150,9 +155,13 @@ public class XmlBeansHyperlinkTest {
|
||||
UriUtil.toUri(xmlFilePath.toFile()).toString()
|
||||
);
|
||||
Path rootContextFilePath = Paths.get(project.getLocationUri()).resolve("src/main/webapp/WEB-INF/spring/root-context.xml");
|
||||
Location expectedLocation = new Location();
|
||||
expectedLocation.setUri(UriUtil.toUri(rootContextFilePath.toFile()).toString());
|
||||
expectedLocation.setRange(new Range(new Position(6,7), new Position(6, 21)));
|
||||
Range targetRange = new Range(new Position(6,7), new Position(6, 21));
|
||||
LocationLink expectedLocation = new LocationLink(
|
||||
UriUtil.toUri(rootContextFilePath.toFile()).toString(),
|
||||
targetRange,
|
||||
targetRange,
|
||||
editor.rangeOf("name=\"simple\" ref=\"simpleObj\"", "simpleObj")
|
||||
);
|
||||
editor.assertLinkTargets("simpleObj", Collections.singleton(expectedLocation));
|
||||
}
|
||||
|
||||
@@ -216,9 +225,13 @@ public class XmlBeansHyperlinkTest {
|
||||
UriUtil.toUri(xmlFilePath.toFile()).toString()
|
||||
);
|
||||
Path rootContextFilePath = Paths.get(project.getLocationUri()).resolve("src/main/webapp/WEB-INF/spring/root-context.xml");
|
||||
Location expectedLocation = new Location();
|
||||
expectedLocation.setUri(UriUtil.toUri(rootContextFilePath.toFile()).toString());
|
||||
expectedLocation.setRange(new Range(new Position(6,7), new Position(6, 21)));
|
||||
Range targetRange = new Range(new Position(6,7), new Position(6, 21));
|
||||
LocationLink expectedLocation = new LocationLink(
|
||||
UriUtil.toUri(rootContextFilePath.toFile()).toString(),
|
||||
targetRange,
|
||||
targetRange,
|
||||
editor.rangeOf("name=\"simple\" ref=\"simpleObj\"", "simpleObj")
|
||||
);
|
||||
editor.assertLinkTargets("simpleObj", Collections.singleton(expectedLocation));
|
||||
}
|
||||
|
||||
|
||||
@@ -395,16 +395,17 @@ public class ApplicationPropertiesEditorTest extends AbstractPropsEditorTest {
|
||||
"flyway.init-sqls=a,b,c\n"
|
||||
);
|
||||
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "server", p,
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "server", p, editor.rangeOf("server.port", "server.port"),
|
||||
method("org.springframework.boot.autoconfigure.web.ServerProperties", "setPort", "java.lang.Integer"));
|
||||
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "data", p,
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "data", p, editor.rangeOf("spring.datasource.login-timeout", "spring.datasource.login-timeout"),
|
||||
method("org.springframework.boot.autoconfigure.jdbc.DataSourceConfigMetadata", "hikariDataSource"),
|
||||
method("org.springframework.boot.autoconfigure.jdbc.DataSourceConfigMetadata", "tomcatDataSource"),
|
||||
method("org.springframework.boot.autoconfigure.jdbc.DataSourceConfigMetadata", "dbcpDataSource")
|
||||
);
|
||||
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "flyway", p, method("org.springframework.boot.autoconfigure.flyway.FlywayProperties", "setInitSqls", "java.util.List"));
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "flyway", p, editor.rangeOf("flyway.init-sqls", "flyway.init-sqls"),
|
||||
method("org.springframework.boot.autoconfigure.flyway.FlywayProperties", "setInitSqls", "java.util.List"));
|
||||
System.out.println("<<< testHyperlinkTargets");
|
||||
}
|
||||
|
||||
@@ -420,7 +421,8 @@ public class ApplicationPropertiesEditorTest extends AbstractPropsEditorTest {
|
||||
"logging.level.com.acme=INFO\n"
|
||||
);
|
||||
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "level", p, "org.springframework.boot.logging.LoggingApplicationListener");
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "level", p, editor.rangeOf("logging.level", "logging.level"),
|
||||
"org.springframework.boot.logging.LoggingApplicationListener");
|
||||
System.out.println("<<< testHyperlinkTargetsLoggingLevel");
|
||||
}
|
||||
|
||||
@@ -1642,7 +1644,9 @@ public class ApplicationPropertiesEditorTest extends AbstractPropsEditorTest {
|
||||
"spring.data.mongodb.field-naming-strategy=org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy\n" +
|
||||
"#more stuff"
|
||||
);
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy", project, "org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy");
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy", project,
|
||||
editor.rangeOf("org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy", "org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy"),
|
||||
"org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy");
|
||||
|
||||
//Linking should also work for types that aren't valid based on the constraints
|
||||
|
||||
@@ -1653,7 +1657,9 @@ public class ApplicationPropertiesEditorTest extends AbstractPropsEditorTest {
|
||||
"spring.data.mongodb.field-naming-strategy=java.lang.String\n" +
|
||||
"#more stuff"
|
||||
);
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "java.lang.String", project, "java.lang.String");
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "java.lang.String", project,
|
||||
editor.rangeOf("java.lang.String", "java.lang.String"),
|
||||
"java.lang.String");
|
||||
|
||||
// Instead of java.lang.String
|
||||
editor = newEditor(
|
||||
@@ -1661,7 +1667,9 @@ public class ApplicationPropertiesEditorTest extends AbstractPropsEditorTest {
|
||||
"spring.data.mongodb.field-naming-strategy=org.springframework.core.io.Resource\n" +
|
||||
"#more stuff"
|
||||
);
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "org.springframework.core.io.Resource", project, "org.springframework.core.io.Resource");
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "org.springframework.core.io.Resource", project,
|
||||
editor.rangeOf("org.springframework.core.io.Resource", "org.springframework.core.io.Resource"),
|
||||
"org.springframework.core.io.Resource");
|
||||
|
||||
}
|
||||
|
||||
@@ -1834,12 +1842,12 @@ public class ApplicationPropertiesEditorTest extends AbstractPropsEditorTest {
|
||||
editor = newEditor(
|
||||
"my.background: RED"
|
||||
);
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "RED", project, field("demo.Color", "RED"));
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "RED", project, editor.rangeOf("RED", "RED"), field("demo.Color", "RED"));
|
||||
|
||||
editor = newEditor(
|
||||
"my.background=red"
|
||||
);
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "red", project, field("demo.Color", "RED"));
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "red", project, editor.rangeOf("red", "red"), field("demo.Color", "RED"));
|
||||
}
|
||||
|
||||
@Test public void testEnumInPojoField() throws Exception {
|
||||
@@ -1851,8 +1859,8 @@ public class ApplicationPropertiesEditorTest extends AbstractPropsEditorTest {
|
||||
editor = newEditor(
|
||||
"my.screen.background=green"
|
||||
);
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "background", project, method("com.example.demo.MyProperties$Screen", "getScreen"));
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "green", project, field("com.example.demo.Color", "GREEN"));
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "background", project, editor.rangeOf("my.screen.background", "my.screen.background"), method("com.example.demo.MyProperties$Screen", "getScreen"));
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "green", project, editor.rangeOf("green", "green"), field("com.example.demo.Color", "GREEN"));
|
||||
}
|
||||
|
||||
@Test public void testNoHoverForUnrecognizedProperty() throws Exception {
|
||||
|
||||
@@ -26,7 +26,6 @@ import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.TestConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
@@ -631,8 +630,8 @@ public class ApplicationYamlEditorTest extends AbstractPropsEditorTest {
|
||||
" getter-only: getme\n"
|
||||
);
|
||||
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "data", project, method("demo.FooProperties", "setData", "demo.ColorData"));
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "wavelen", project, method("demo.ColorData", "setWavelen", "double"));
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "data", project, editor.rangeOf("data:", "data"), method("demo.FooProperties", "setData", "demo.ColorData"));
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "wavelen", project, editor.rangeOf("wavelen:", "wavelen"), method("demo.ColorData", "setWavelen", "double"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -653,11 +652,11 @@ public class ApplicationYamlEditorTest extends AbstractPropsEditorTest {
|
||||
//io.spring.initializr.metadata.DefaultMetadataElement.setDefault(boolean)
|
||||
//io.spring.initializr.metadata.MetadataElement.setId(String)
|
||||
//io.spring.initializr.metadata.MetadataElement.setName(String)
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "name", project, method("io.spring.initializr.metadata.MetadataElement", "setName", "java.lang.String"));
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "id", project, method("io.spring.initializr.metadata.MetadataElement", "setId", "java.lang.String"));
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "default", project, method("io.spring.initializr.metadata.DefaultMetadataElement", "setDefault", "boolean"));
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "name", project, editor.rangeOf("name:", "name"), method("io.spring.initializr.metadata.MetadataElement", "setName", "java.lang.String"));
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "id", project, editor.rangeOf("id:", "id"), method("io.spring.initializr.metadata.MetadataElement", "setId", "java.lang.String"));
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "default", project, editor.rangeOf("default:", "default"), method("io.spring.initializr.metadata.DefaultMetadataElement", "setDefault", "boolean"));
|
||||
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "bogus", project /*NONE*/);
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "bogus", project, editor.rangeOf("bogus", "bogus") /*NONE*/);
|
||||
}
|
||||
|
||||
@Test public void testHyperlinkTargets() throws Exception {
|
||||
@@ -675,14 +674,17 @@ public class ApplicationYamlEditorTest extends AbstractPropsEditorTest {
|
||||
);
|
||||
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "port", p,
|
||||
editor.rangeOf("port", "port"),
|
||||
method("org.springframework.boot.autoconfigure.web.ServerProperties", "setPort", "java.lang.Integer")
|
||||
);
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "login-", p,
|
||||
editor.rangeOf("login-timeout", "login-timeout"),
|
||||
method("org.springframework.boot.autoconfigure.jdbc.DataSourceConfigMetadata", "hikariDataSource"),
|
||||
method("org.springframework.boot.autoconfigure.jdbc.DataSourceConfigMetadata", "tomcatDataSource"),
|
||||
method("org.springframework.boot.autoconfigure.jdbc.DataSourceConfigMetadata", "dbcpDataSource")
|
||||
);
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "init-sql", p,
|
||||
editor.rangeOf("init-sqls", "init-sqls"),
|
||||
method("org.springframework.boot.autoconfigure.flyway.FlywayProperties", "setInitSqls", "java.util.List"));
|
||||
}
|
||||
|
||||
@@ -3858,7 +3860,9 @@ public class ApplicationYamlEditorTest extends AbstractPropsEditorTest {
|
||||
" mongodb:\n" +
|
||||
" field-naming-strategy: org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy\n"
|
||||
);
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy", project, "org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy");
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy", project,
|
||||
editor.rangeOf("org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy", "org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy"),
|
||||
"org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy");
|
||||
|
||||
editor = newEditor(
|
||||
"spring:\n" +
|
||||
@@ -3867,7 +3871,9 @@ public class ApplicationYamlEditorTest extends AbstractPropsEditorTest {
|
||||
" field-naming-strategy:\n" +
|
||||
" org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy\n"
|
||||
);
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy", project, "org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy");
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy", project,
|
||||
editor.rangeOf("org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy", "org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy"),
|
||||
"org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy");
|
||||
|
||||
//Linking should also work for types that aren't valid based on the constraints
|
||||
editor = newEditor(
|
||||
@@ -3877,7 +3883,7 @@ public class ApplicationYamlEditorTest extends AbstractPropsEditorTest {
|
||||
" field-naming-strategy: java.lang.String\n" +
|
||||
"#more stuff"
|
||||
);
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "java.lang.String", project, "java.lang.String");
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "java.lang.String", project, editor.rangeOf("java.lang.String", "java.lang.String"), "java.lang.String");
|
||||
}
|
||||
|
||||
@Test public void test_STS_3335_reconcile_list_nested_in_Map_of_String() throws Exception {
|
||||
@@ -4022,13 +4028,13 @@ public class ApplicationYamlEditorTest extends AbstractPropsEditorTest {
|
||||
"my:\n" +
|
||||
" background: RED"
|
||||
);
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "RED", project, field("demo.Color", "RED"));
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "RED", project, editor.rangeOf("RED", "RED"), field("demo.Color", "RED"));
|
||||
|
||||
editor = newEditor(
|
||||
"my:\n" +
|
||||
" background: red"
|
||||
);
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "red", project, field("demo.Color", "RED"));
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "red", project, editor.rangeOf("red", "red"), field("demo.Color", "RED"));
|
||||
}
|
||||
|
||||
@Test public void testHyperLinkEnumValueInMapKey() throws Exception {
|
||||
@@ -4044,8 +4050,8 @@ public class ApplicationYamlEditorTest extends AbstractPropsEditorTest {
|
||||
" RED: Rood\n" +
|
||||
" green: Groen\n"
|
||||
);
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "RED", project, field("demo.Color", "RED"));
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "green", project, field("demo.Color", "GREEN"));
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "RED", project, editor.rangeOf("RED", "RED"), field("demo.Color", "RED"));
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "green", project, editor.rangeOf("green", "green"), field("demo.Color", "GREEN"));
|
||||
|
||||
editor = newEditor(
|
||||
"spring:\n" +
|
||||
@@ -4054,6 +4060,7 @@ public class ApplicationYamlEditorTest extends AbstractPropsEditorTest {
|
||||
" INDENT_OUTPUT: true"
|
||||
);
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "INDENT_OUTPUT", project,
|
||||
editor.rangeOf("INDENT_OUTPUT", "INDENT_OUTPUT"),
|
||||
field("com.fasterxml.jackson.databind.SerializationFeature", "INDENT_OUTPUT")
|
||||
);
|
||||
|
||||
@@ -4064,6 +4071,7 @@ public class ApplicationYamlEditorTest extends AbstractPropsEditorTest {
|
||||
" indent-output: true"
|
||||
);
|
||||
definitionLinkAsserts.assertLinkTargets(editor, "indent-output", project,
|
||||
editor.rangeOf("indent-output", "indent-output"),
|
||||
field("com.fasterxml.jackson.databind.SerializationFeature", "INDENT_OUTPUT")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 Pivotal, Inc.
|
||||
* Copyright (c) 2018, 2019 Pivotal, Inc.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
@@ -27,6 +27,7 @@ import org.eclipse.jdt.core.dom.SimpleName;
|
||||
import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
|
||||
import org.eclipse.jdt.core.dom.TypeDeclaration;
|
||||
import org.eclipse.lsp4j.Location;
|
||||
import org.eclipse.lsp4j.LocationLink;
|
||||
import org.eclipse.lsp4j.Range;
|
||||
import org.springframework.ide.vscode.boot.java.links.JavaDocumentUriProvider;
|
||||
import org.springframework.ide.vscode.boot.java.links.SourceLinks;
|
||||
@@ -88,34 +89,34 @@ public class DefinitionLinkAsserts {
|
||||
|
||||
}
|
||||
|
||||
public void assertLinkTargets(Editor editor, String hoverOver, IJavaProject project, JavaMethod... methods) throws Exception {
|
||||
Set<Location> expectedLocations = Arrays.stream(methods).map(method -> {
|
||||
public void assertLinkTargets(Editor editor, String hoverOver, IJavaProject project, Range highlightRange, JavaMethod... methods) throws Exception {
|
||||
Set<LocationLink> expectedLocations = Arrays.stream(methods).map(method -> {
|
||||
try {
|
||||
return getLocation(project, method);
|
||||
} catch (Exception e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
}).collect(Collectors.toSet());
|
||||
}).map(l -> new LocationLink(l.getUri(), l.getRange(), l.getRange(), highlightRange)).collect(Collectors.toSet());
|
||||
|
||||
editor.assertLinkTargets(hoverOver, expectedLocations);
|
||||
}
|
||||
|
||||
public void assertLinkTargets(Editor editor, String hoverOver, IJavaProject project, String typeFqName) throws Exception {
|
||||
public void assertLinkTargets(Editor editor, String hoverOver, IJavaProject project, Range highlightRange, String typeFqName) throws Exception {
|
||||
|
||||
Location expectedLocation = getLocation(project, typeFqName);
|
||||
Location l = getLocation(project, typeFqName);
|
||||
|
||||
LocationLink link = new LocationLink(l.getUri(), l.getRange(), l.getRange(), highlightRange);
|
||||
|
||||
System.out.println("Expected Location: " + expectedLocation);
|
||||
|
||||
editor.assertLinkTargets(hoverOver, ImmutableSet.of(expectedLocation));
|
||||
editor.assertLinkTargets(hoverOver, ImmutableSet.of(link));
|
||||
}
|
||||
|
||||
public void assertLinkTargets(Editor editor, String hoverOver, IJavaProject project, JavaField field) throws Exception {
|
||||
public void assertLinkTargets(Editor editor, String hoverOver, IJavaProject project, Range highlightRange, JavaField field) throws Exception {
|
||||
|
||||
Location expectedLocation = getLocation(project, field);
|
||||
Location l = getLocation(project, field);
|
||||
|
||||
System.out.println("Expected Location: " + expectedLocation);
|
||||
LocationLink link = new LocationLink(l.getUri(), l.getRange(), l.getRange(), highlightRange);
|
||||
|
||||
editor.assertLinkTargets(hoverOver, ImmutableSet.of(expectedLocation));
|
||||
editor.assertLinkTargets(hoverOver, ImmutableSet.of(link));
|
||||
}
|
||||
|
||||
private Location getLocation(IJavaProject project, String fqName) throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user