public void write(final JsonWriter out, final Hover value) throws IOException { if (value == null) { out.nullValue(); return; } out.beginObject(); out.name("contents"); writeContents(out, value.getContents()); out.name("range"); writeRange(out, value.getRange()); out.endObject(); }
public void write(final JsonWriter out, final Hover value) throws IOException { if (value == null) { out.nullValue(); return; } out.beginObject(); out.name("contents"); writeContents(out, value.getContents()); out.name("range"); writeRange(out, value.getRange()); out.endObject(); }
public void assertNoHover(String hoverOver, int occurence) throws Exception { int hoverPosition = getHoverPosition(hoverOver,occurence); Hover hover = harness.getHover(doc, doc.toPosition(hoverPosition)); List<Either<String, MarkedString>> contents = hover.getContents().getLeft(); assertTrue(contents.toString(), contents.isEmpty()); }
public String hoverString(Hover hover) { StringBuilder buf = new StringBuilder(); boolean first = true; Either<List<Either<String, MarkedString>>, MarkupContent> contents = hover.getContents(); for (Either<String, MarkedString> block : contents.getLeft()) { if (!first) { buf.append("\n\n"); } if (block.isLeft()) { String s = block.getLeft(); buf.append(s); } else if (block.isRight()) { MarkedString ms = block.getRight(); buf.append("```"+ms.getLanguage()+"\n"); buf.append(ms.getValue()); buf.append("\n```"); } first = false; } return buf.toString(); }
if (hover != null) { Either<List<Either<String, MarkedString>>, MarkupContent> contents = hover.getContents();
setRange((org.eclipse.lsp4j.Range)rangeVal); if (o.getContents() == null) { setContents((org.eclipse.lsp4j.jsonrpc.messages.Either<java.util.List<org.eclipse.lsp4j.jsonrpc.messages.Either<java.lang.String, org.eclipse.lsp4j.MarkedString>>, org.eclipse.lsp4j.MarkupContent>)null); } else { org.eclipse.lsp4j.jsonrpc.messages.Either<java.util.List<org.eclipse.lsp4j.jsonrpc.messages.Either<java.lang.String, org.eclipse.lsp4j.MarkedString>>, org.eclipse.lsp4j.MarkupContent> contentsVal; if (o.getContents().getLeft() != null) { ArrayList<org.eclipse.lsp4j.jsonrpc.messages.Either<java.lang.String, org.eclipse.lsp4j.MarkedString>> contentsVale= new ArrayList<org.eclipse.lsp4j.jsonrpc.messages.Either<java.lang.String, org.eclipse.lsp4j.MarkedString>>(); for (org.eclipse.lsp4j.jsonrpc.messages.Either<java.lang.String, org.eclipse.lsp4j.MarkedString> contentsValeX : o.getContents().getLeft()) { org.eclipse.lsp4j.jsonrpc.messages.Either<java.lang.String, org.eclipse.lsp4j.MarkedString> contentsValeY; if (contentsValeX.getLeft() != null) { org.eclipse.lsp4j.MarkupContent contentsVale = new MarkupContentDto(o.getContents().getRight()); contentsVal= Either.forRight(contentsVale);