added html rendering to java boot hovers

This commit is contained in:
Martin Lippert
2017-08-25 12:20:26 +02:00
parent ab66f81fa3
commit 0722590864
2 changed files with 9 additions and 2 deletions

View File

@@ -11,7 +11,9 @@
package org.springframework.tooling.boot.java.ls.jdt;
import org.eclipse.jdt.ui.text.java.hover.IJavaEditorTextHover;
import org.eclipse.jface.text.IInformationControlCreator;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITextHoverExtension;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.lsp4e.operations.hover.LSBasedHover;
import org.eclipse.ui.IEditorPart;
@@ -20,7 +22,7 @@ import org.eclipse.ui.IEditorPart;
* @author Martin Lippert
*/
@SuppressWarnings("restriction")
public class SpringBootJavaHoverProvider implements IJavaEditorTextHover {
public class SpringBootJavaHoverProvider implements IJavaEditorTextHover, ITextHoverExtension {
private LSBasedHover lsBasedHover;
@@ -42,4 +44,9 @@ public class SpringBootJavaHoverProvider implements IJavaEditorTextHover {
public void setEditor(IEditorPart editor) {
}
@Override
public IInformationControlCreator getHoverControlCreator() {
return this.lsBasedHover.getHoverControlCreator();
}
}

View File

@@ -74,7 +74,7 @@ public class RequestMappingHoverProvider {
while (keys.hasNext()) {
String key = keys.next();
if (doesMatch(annotation, key)) {
hoverContent.add(Either.forLeft(key));
hoverContent.add(Either.forLeft(key + " - [url of the mapping](http://localhost:8080/path)"));
hoverContent.add(Either.forLeft(jsonObject.get(key).toString()));
}
}