PT #155474415: CTRL-CLICK navigation from .properties to Java

This commit is contained in:
BoykoAlex
2018-11-06 16:45:21 -05:00
parent a95d74d0b9
commit f2be2c717b
52 changed files with 1998 additions and 396 deletions

View File

@@ -45,6 +45,8 @@ class BindingKeyUtils {
sb.append(getBindingKey(field.declaringClass()));
sb.append('.');
sb.append(field.name());
sb.append(')');
sb.append(getGeneralTypeBindingKey(field.type()));
return sb.toString();
}
@@ -104,6 +106,9 @@ class BindingKeyUtils {
sb.append(getGeneralTypeBindingKey(argument));
}
sb.append('>');
if (type.owner() == null) {
sb.append(';');
}
return sb.toString();
}

View File

@@ -53,7 +53,7 @@ class TypeImpl implements IType {
@Override
public IType getDeclaringType() {
DotName enclosingClass = info.enclosingClass();
return enclosingClass == null ? null : index.findType(enclosingClass.toString());
return enclosingClass == null ? this : index.findType(enclosingClass.toString());
}
@Override

View File

@@ -11,6 +11,8 @@
package org.springframework.ide.vscode.commons.java;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -37,4 +39,28 @@ public class BootProjectUtil {
return name.endsWith(".jar") && name.startsWith("spring-boot");
}
public static Path javaHomeFromLibJar(Path libJar) {
for (Path home = libJar; home.getParent() != null; home = home.getParent()) {
if (Files.exists(home.resolve("release")) || Files.exists(home.resolve("release.txt"))) {
return home;
}
}
return null;
}
public static Path jreSources(Path libJar) {
Path home = javaHomeFromLibJar(libJar);
if (home != null) {
Path sources = home.resolve("src.zip");
if (Files.exists(sources)) {
return sources;
}
sources = home.resolve("lib/src.zip");
if (Files.exists(sources)) {
return sources;
}
}
return null;
}
}