Remove extra info from completion proposal documentation section
This commit is contained in:
@@ -63,7 +63,7 @@ public class LoggerNameProviderTest {
|
||||
String query = "jboss";
|
||||
List<String> directQueryResults = getResults(p, query);
|
||||
|
||||
dumpResults("jboss - DIRECT", directQueryResults);
|
||||
// dumpResults("jboss - DIRECT", directQueryResults);
|
||||
|
||||
/*
|
||||
* Commented out due to search results from JDK present
|
||||
@@ -99,7 +99,7 @@ public class LoggerNameProviderTest {
|
||||
for (int i = 0; i <= fullQuery.length(); i++) {
|
||||
String query = fullQuery.substring(0, i);
|
||||
List<String> results = getResults(p, query);
|
||||
dumpResults(query, results);
|
||||
// dumpResults(query, results);
|
||||
if (i==fullQuery.length()) {
|
||||
System.out.println("Verifying final result!");
|
||||
//Not checking for exact equals because... quircks of JDT search engine means it
|
||||
@@ -146,6 +146,7 @@ public class LoggerNameProviderTest {
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private void dumpResults(String string, Collection<String> r) {
|
||||
System.out.println(">>> "+string);
|
||||
String[] strings = r.toArray(new String[r.size()]);
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.springframework.ide.vscode.commons.languageserver.completion.IComplet
|
||||
import org.springframework.ide.vscode.commons.languageserver.completion.ScoreableProposal;
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.IDocument;
|
||||
import org.springframework.ide.vscode.commons.util.Renderable;
|
||||
import org.springframework.ide.vscode.commons.yaml.hover.YPropertyHoverInfo;
|
||||
import org.springframework.ide.vscode.commons.yaml.hover.YPropertyInfoTemplates;
|
||||
import org.springframework.ide.vscode.commons.yaml.schema.YType;
|
||||
import org.springframework.ide.vscode.commons.yaml.schema.YTypeUtil;
|
||||
import org.springframework.ide.vscode.commons.yaml.schema.YTypedProperty;
|
||||
@@ -64,7 +64,7 @@ public class DefaultCompletionFactory implements CompletionFactory {
|
||||
|
||||
@Override
|
||||
public Renderable getDocumentation() {
|
||||
return YPropertyHoverInfo.create(contextProperty, contextType, p);
|
||||
return YPropertyInfoTemplates.createCompletionDocumentation(contextProperty, contextType, p);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.ide.vscode.commons.languageserver.util.DocumentRegion
|
||||
import org.springframework.ide.vscode.commons.util.CollectionUtil;
|
||||
import org.springframework.ide.vscode.commons.util.FuzzyMatcher;
|
||||
import org.springframework.ide.vscode.commons.util.Renderable;
|
||||
import org.springframework.ide.vscode.commons.yaml.hover.YPropertyHoverInfo;
|
||||
import org.springframework.ide.vscode.commons.yaml.hover.YPropertyInfoTemplates;
|
||||
import org.springframework.ide.vscode.commons.yaml.path.YamlPath;
|
||||
import org.springframework.ide.vscode.commons.yaml.path.YamlPathSegment;
|
||||
import org.springframework.ide.vscode.commons.yaml.path.YamlPathSegment.YamlPathSegmentType;
|
||||
@@ -238,7 +238,7 @@ public class YTypeAssistContext extends AbstractYamlAssistContext {
|
||||
case KEY_AT_KEY:
|
||||
YTypedProperty prop = getProperty(lastSegment.toPropString());
|
||||
if (prop!=null) {
|
||||
return YPropertyHoverInfo.create(contextPath.toPropString(), getType(), prop);
|
||||
return YPropertyInfoTemplates.createHover(contextPath.toPropString(), getType(), prop);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -17,6 +17,7 @@ import static org.springframework.ide.vscode.commons.util.Renderables.link;
|
||||
import static org.springframework.ide.vscode.commons.util.Renderables.text;
|
||||
|
||||
import org.springframework.ide.vscode.commons.util.Renderable;
|
||||
import org.springframework.ide.vscode.commons.util.Renderables;
|
||||
import org.springframework.ide.vscode.commons.util.StringUtil;
|
||||
import org.springframework.ide.vscode.commons.yaml.schema.YType;
|
||||
import org.springframework.ide.vscode.commons.yaml.schema.YTypedProperty;
|
||||
@@ -29,9 +30,9 @@ import com.google.common.collect.ImmutableList.Builder;
|
||||
*
|
||||
* @author Kris De Volder
|
||||
*/
|
||||
public class YPropertyHoverInfo {
|
||||
public class YPropertyInfoTemplates {
|
||||
|
||||
public static Renderable create(String contextProperty, YType contextType, YTypedProperty prop) {
|
||||
public static Renderable createHover(String contextProperty, YType contextType, YTypedProperty prop) {
|
||||
|
||||
Builder<Renderable> html = ImmutableList.builder();
|
||||
if (StringUtil.hasText(contextProperty)) {
|
||||
@@ -57,5 +58,15 @@ public class YPropertyHoverInfo {
|
||||
|
||||
return concat(html.build());
|
||||
}
|
||||
|
||||
public static Renderable createCompletionDocumentation(String contextProperty, YType contextType, YTypedProperty prop) {
|
||||
/*
|
||||
* More parameters present to be able to quickly change the format.
|
||||
* Currently the format for the documentation is just the property
|
||||
* description
|
||||
*/
|
||||
Renderable r = prop.getDescription();
|
||||
return r == Renderables.NO_DESCRIPTION ? null : r;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,7 +15,7 @@ import org.springframework.ide.vscode.commons.languageserver.completion.Document
|
||||
import org.springframework.ide.vscode.commons.languageserver.completion.ScoreableProposal;
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.IDocument;
|
||||
import org.springframework.ide.vscode.commons.util.Renderable;
|
||||
import org.springframework.ide.vscode.commons.yaml.hover.YPropertyHoverInfo;
|
||||
import org.springframework.ide.vscode.commons.yaml.hover.YPropertyInfoTemplates;
|
||||
import org.springframework.ide.vscode.commons.yaml.schema.YType;
|
||||
import org.springframework.ide.vscode.commons.yaml.schema.YTypeUtil;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.springframework.ide.vscode.commons.languageserver.completion.Scoreabl
|
||||
import org.springframework.ide.vscode.commons.languageserver.java.JavaProjectFinder;
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.IDocument;
|
||||
import org.springframework.ide.vscode.commons.util.Renderable;
|
||||
import org.springframework.ide.vscode.commons.yaml.hover.YPropertyHoverInfo;
|
||||
import org.springframework.ide.vscode.commons.yaml.hover.YPropertyInfoTemplates;
|
||||
import org.springframework.ide.vscode.commons.yaml.schema.YType;
|
||||
|
||||
import com.google.common.base.Supplier;
|
||||
@@ -75,7 +75,7 @@ public class PropertyCompletionFactory {
|
||||
|
||||
@Override
|
||||
public Renderable getDocumentation() {
|
||||
return YPropertyHoverInfo.create(contextProperty, contextType, property);
|
||||
return YPropertyInfoTemplates.createCompletionDocumentation(contextProperty, contextType, property);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user