PT #158305140 Fix javadoc on eclipse client, make javadoc lazy on server

This commit is contained in:
BoykoAlex
2018-06-12 20:58:32 -04:00
parent 23fd1e460d
commit 58ace93d32
3 changed files with 11 additions and 9 deletions

View File

@@ -18,7 +18,8 @@ Require-Bundle: org.eclipse.jdt.launching;bundle-version="3.8.0",
org.springframework.tooling.jdt.ls.commons,
org.eclipse.ui.ide,
org.eclipse.jdt.core,
org.eclipse.jdt.ui
org.eclipse.jdt.ui,
org.apache.commons.lang3
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Export-Package: org.springframework.tooling.ls.eclipse.commons,

View File

@@ -56,6 +56,7 @@ import org.springframework.ide.vscode.commons.util.EnumValueParser;
import org.springframework.ide.vscode.commons.util.LazyProvider;
import org.springframework.ide.vscode.commons.util.Log;
import org.springframework.ide.vscode.commons.util.MimeTypes;
import org.springframework.ide.vscode.commons.util.Renderables;
import org.springframework.ide.vscode.commons.util.StringUtil;
import org.springframework.ide.vscode.commons.util.ValueParser;
@@ -125,7 +126,7 @@ public class TypeUtil {
}
private IJavaProject javaProject;
public TypeUtil(IJavaProject jp) {
//Note javaProject is allowed to be null, but only in unit testing context
// (This is so some tests can be run without an explicit jp needing to be created)
@@ -654,11 +655,11 @@ public class TypeUtil {
}
if (beanMode.includesHyphenated()) {
properties.add(new TypedProperty(getterOrSetterNameToProperty(m.getElementName()), propType,
PropertyDocUtils.documentJavaElement(sourceLinks, project, m), deprecation));
Renderables.lazy(() -> PropertyDocUtils.documentJavaElement(sourceLinks, project, m)), deprecation));
}
if (beanMode.includesCamelCase()) {
properties.add(new TypedProperty(getterOrSetterNameToCamelName(m.getElementName()), propType,
PropertyDocUtils.documentJavaElement(sourceLinks, project, m), deprecation));
Renderables.lazy(() -> PropertyDocUtils.documentJavaElement(sourceLinks, project, m)), deprecation));
}
});
return properties;
@@ -822,15 +823,15 @@ public class TypeUtil {
}
public Optional<IMethod> getSetter(Type beanType, String propName) {
public IMethod getSetter(Type beanType, String propName) {
try {
String setterName = "set" + StringUtil.hyphensToCamelCase(propName, true);
IType type = findType(beanType);
return type.getMethods().filter(m -> setterName.equals(m.getElementName())).findFirst();
return type.getMethods().filter(m -> setterName.equals(m.getElementName())).findFirst().orElse(null);
} catch (Exception e) {
Log.log(e);
}
return Optional.empty();
return null;
}
public IJavaElement getGetter(Type beanType, String propName) {

View File

@@ -77,7 +77,7 @@ import com.google.common.collect.ImmutableList;
* content assistance.
*/
public abstract class ApplicationYamlAssistContext extends AbstractYamlAssistContext {
private static Logger log = LoggerFactory.getLogger(ApplicationYamlAssistContext.class);
protected final RelaxedNameConfig conf;
@@ -577,7 +577,7 @@ public abstract class ApplicationYamlAssistContext extends AbstractYamlAssistCon
} else {
ArrayList<IJavaElement> elements = new ArrayList<IJavaElement>(3);
maybeAdd(elements, typeUtil.getField(beanType, propName));
maybeAdd(elements, typeUtil.getSetter(beanType, propName).get());
maybeAdd(elements, typeUtil.getSetter(beanType, propName));
maybeAdd(elements, typeUtil.getGetter(beanType, propName));
if (!elements.isEmpty()) {
return elements;