Java Code Examples for org.eclipse.lsp4j.MarkedString

The following examples show how to use org.eclipse.lsp4j.MarkedString. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: n4js   Source File: N4JSHoverService.java    License: Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected List<Either<String, MarkedString>> getContents(HoverContext ctx) {
	List<Either<String, MarkedString>> contents = new LinkedList<>();
	EObject element = ctx.getElement();
	EObject idRef = getIdentifierRefOrElement(ctx);

	String signature = signatureProvider.get(idRef);
	if (signature != null) {
		String keyword = keywordProvider.keyword(element);
		String signatureLabel = composeFirstLine(keyword, signature);
		CharSequence signatureAdoc = html2adocConverter.transformHTML(signatureLabel);
		MarkedString mdSignatureLabel = new MarkedString("n4js", signatureAdoc.toString());
		contents.add(Either.forRight(mdSignatureLabel));
	}

	String documentation = documentationProvider.getDocumentation(element);
	if (documentation != null) {
		CharSequence docuAdoc = html2adocConverter.transformHTML(documentation);
		MarkedString mdDocumentation = new MarkedString(MARKUP_KIND_MARKDOWN, docuAdoc.toString());
		contents.add(Either.forRight(mdDocumentation));
	}

	return contents;
}
 
Example 2
Source Project: eclipse.jdt.ls   Source File: SyntaxServerTest.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testHover() throws Exception {
	URI fileURI = openFile("maven/salut4", "src/main/java/java/TestJavadoc.java");
	String fileUri = ResourceUtils.fixURI(fileURI);
	TextDocumentIdentifier identifier = new TextDocumentIdentifier(fileUri);
	HoverParams params = new HoverParams(identifier, new Position(8, 23));
	Hover result = server.hover(params).join();
	assertNotNull(result);
	assertNotNull(result.getContents());
	assertTrue(result.getContents().isLeft());
	List<Either<String, MarkedString>> list = result.getContents().getLeft();
	assertNotNull(list);
	assertEquals(2, list.size());
	assertTrue(list.get(1).isLeft());
	assertEquals("Test", list.get(1).getLeft());
}
 
Example 3
Source Project: eclipse.jdt.ls   Source File: SyntaxServerTest.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testHoverType() throws Exception {
	URI fileURI = openFile("maven/salut4", "src/main/java/java/Foo.java");
	String fileUri = ResourceUtils.fixURI(fileURI);
	TextDocumentIdentifier identifier = new TextDocumentIdentifier(fileUri);
	HoverParams params = new HoverParams(identifier, new Position(11, 9));
	Hover result = server.hover(params).join();
	assertNotNull(result);
	assertNotNull(result.getContents());
	assertTrue(result.getContents().isLeft());
	List<Either<String, MarkedString>> list = result.getContents().getLeft();
	assertNotNull(list);
	assertEquals(2, list.size());
	assertTrue(list.get(1).isLeft());
	assertEquals("This is Bar.", list.get(1).getLeft());
}
 
Example 4
Source Project: eclipse.jdt.ls   Source File: SyntaxServerTest.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testHoverUnresolvedType() throws Exception {
	URI fileURI = openFile("maven/salut4", "src/main/java/java/Foo.java");
	String fileUri = ResourceUtils.fixURI(fileURI);
	TextDocumentIdentifier identifier = new TextDocumentIdentifier(fileUri);
	HoverParams params = new HoverParams(identifier, new Position(7, 30));
	Hover result = server.hover(params).join();
	assertNotNull(result);
	assertNotNull(result.getContents());
	assertTrue(result.getContents().isLeft());
	List<Either<String, MarkedString>> list = result.getContents().getLeft();
	assertNotNull(list);
	assertEquals(2, list.size());
	assertTrue(list.get(1).isLeft());
	assertEquals("This is interface IFoo.", list.get(1).getLeft());
}
 
Example 5
Source Project: eclipse.jdt.ls   Source File: HoverHandlerTest.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testHover() throws Exception {
	//given
	//Hovers on the System.out
	String payload = createHoverRequest("src/java/Foo.java", 5, 15);
	TextDocumentPositionParams position = getParams(payload);

	//when
	Hover hover = handler.hover(position, monitor);

	//then
	assertNotNull(hover);
	assertNotNull(hover.getContents());
	MarkedString signature = hover.getContents().getLeft().get(0).getRight();
	assertEquals("Unexpected hover " + signature, "java", signature.getLanguage());
	assertEquals("Unexpected hover " + signature, "java.Foo", signature.getValue());
	String doc = hover.getContents().getLeft().get(1).getLeft();
	assertEquals("Unexpected hover " + doc, "This is foo", doc);
}
 
Example 6
Source Project: eclipse.jdt.ls   Source File: HoverHandlerTest.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testHoverStandalone() throws Exception {
	//given
	//Hovers on the System.out
	URI standalone = Paths.get("projects", "maven", "salut", "src", "main", "java", "java", "Foo.java").toUri();
	String payload = createHoverRequest(standalone, 10, 71);
	TextDocumentPositionParams position = getParams(payload);

	//when
	Hover hover = handler.hover(position, monitor);

	//then
	assertNotNull(hover);
	assertNotNull(hover.getContents());
	MarkedString signature = hover.getContents().getLeft().get(0).getRight();
	assertEquals("Unexpected hover " + signature, "java", signature.getLanguage());
	assertEquals("Unexpected hover " + signature, "java.Foo", signature.getValue());
	String doc = hover.getContents().getLeft().get(1).getLeft();
	assertEquals("Unexpected hover " + doc, "This is foo", doc);
}
 
Example 7
Source Project: eclipse.jdt.ls   Source File: HoverHandlerTest.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testHoverVariable() throws Exception {
	//given
	//Hover on args parameter
	String argParam = createHoverRequest("src/java/Foo.java", 7, 37);
	TextDocumentPositionParams position = getParams(argParam);

	//when
	Hover hover = handler.hover(position, monitor);

	//then
	assertNotNull(hover);
	assertNotNull(hover.getContents());
	MarkedString signature = hover.getContents().getLeft().get(0).getRight();
	assertEquals("Unexpected hover " + signature, "java", signature.getLanguage());
	assertEquals("Unexpected hover " + signature, "String[] args - java.Foo.main(String[])", signature.getValue());
}
 
Example 8
Source Project: eclipse.jdt.ls   Source File: HoverHandlerTest.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testHoverWithAttachedJavadoc() throws Exception {
	File commonPrimitivesJdoc = DependencyUtil.getJavadoc("commons-primitives", "commons-primitives", "1.0");
	assertNotNull("Unable to locate  commons-primitives-1.0-javadoc.jar", commonPrimitivesJdoc);

	importProjects("maven/attached-javadoc");
	project = WorkspaceHelper.getProject("attached-javadoc");
	handler = new HoverHandler(preferenceManager);
	//given
	//Hovers on org.apache.commons.collections.primitives.ShortCollections which has no source but an attached javadoc
	String payload = createHoverRequest("src/main/java/org/sample/Bar.java", 2, 56);
	TextDocumentPositionParams position = getParams(payload);

	// when
	Hover hover = handler.hover(position, monitor);
	assertNotNull("Hover is null", hover);
	assertEquals("Unexpected hover contents:\n" + hover.getContents(), 2, hover.getContents().getLeft().size());
	Either<String, MarkedString> javadoc = hover.getContents().getLeft().get(1);
	String content = null;
	assertTrue("javadoc has null content", javadoc != null && javadoc.getLeft() != null && (content = javadoc.getLeft()) != null);
	assertTrue("Unexpected hover :\n" + content, content.contains("This class consists exclusively of static methods that operate on or return ShortCollections"));
	assertTrue("Unexpected hover :\n" + content, content.contains("**Author:**"));
}
 
Example 9
Source Project: eclipse.jdt.ls   Source File: HoverHandlerTest.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testHoverOnJavadocWithValueTag() throws Exception {
	importProjects("maven/salut");
	project = WorkspaceHelper.getProject("salut");
	handler = new HoverHandler(preferenceManager);
	//given
	String payload = createHoverRequest("src/main/java/java/Foo2.java", 12, 30);
	TextDocumentPositionParams position = getParams(payload);

	// when
	Hover hover = handler.hover(position, monitor);
	assertNotNull("Hover is null", hover);
	assertEquals("Unexpected hover contents:\n" + hover.getContents(), 2, hover.getContents().getLeft().size());
	Either<String, MarkedString> javadoc = hover.getContents().getLeft().get(1);
	String content = null;
	assertTrue("javadoc has null content", javadoc != null && javadoc.getLeft() != null && (content = javadoc.getLeft()) != null);
	assertMatches("\\[\"SimpleStringData\"\\]\\(file:/.*/salut/src/main/java/java/Foo2.java#13\\) is a simple String", content);
}
 
Example 10
Source Project: eclipse.jdt.ls   Source File: HoverHandlerTest.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testHoverOnJavadocWithLinkToMethodInClass() throws Exception {
	importProjects("maven/salut");
	project = WorkspaceHelper.getProject("salut");
	handler = new HoverHandler(preferenceManager);
	//given
	String payload = createHoverRequest("src/main/java/java/Foo2.java", 18, 25);
	TextDocumentPositionParams position = getParams(payload);

	// when
	Hover hover = handler.hover(position, monitor);
	assertNotNull("Hover is null", hover);
	assertEquals("Unexpected hover contents:\n" + hover.getContents(), 2, hover.getContents().getLeft().size());
	Either<String, MarkedString> javadoc = hover.getContents().getLeft().get(1);
	String content = null;
	assertTrue("javadoc has null content", javadoc != null && javadoc.getLeft() != null && (content = javadoc.getLeft()) != null);
	assertMatches("\\[newMethodBeingLinkedToo\\]\\(file:/.*/salut/src/main/java/java/Foo2.java#23\\)", content);
}
 
Example 11
Source Project: eclipse.jdt.ls   Source File: HoverHandlerTest.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testHoverOnJavadocWithLinkToMethodInOtherClass() throws Exception {
	importProjects("maven/salut");
	project = WorkspaceHelper.getProject("salut");
	handler = new HoverHandler(preferenceManager);

	//given
	String payload = createHoverRequest("src/main/java/java/Foo2.java", 29, 25);
	TextDocumentPositionParams position = getParams(payload);

	// when
	Hover hover = handler.hover(position, monitor);
	assertNotNull("Hover is null", hover);
	assertEquals("Unexpected hover contents:\n" + hover.getContents(), 2, hover.getContents().getLeft().size());
	Either<String, MarkedString> javadoc = hover.getContents().getLeft().get(1);
	String content = null;
	assertTrue("javadoc has null content", javadoc != null && javadoc.getLeft() != null && (content = javadoc.getLeft()) != null);
	assertMatches("\\[Foo.linkedFromFoo2\\(\\)\\]\\(file:/.*/salut/src/main/java/java/Foo.java#14\\)", content);
}
 
Example 12
Source Project: eclipse.jdt.ls   Source File: HoverHandlerTest.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testHoverWhenLinkDoesNotExist() throws Exception {
	importProjects("maven/salut");
	project = WorkspaceHelper.getProject("salut");
	handler = new HoverHandler(preferenceManager);

	//given
	String payload = createHoverRequest("src/main/java/java/Foo2.java", 51, 25);
	TextDocumentPositionParams position = getParams(payload);

	// when
	Hover hover = handler.hover(position, monitor);
	assertNotNull("Hover is null", hover);
	assertEquals("Unexpected hover contents:\n" + hover.getContents(), 2, hover.getContents().getLeft().size());
	Either<String, MarkedString> javadoc = hover.getContents().getLeft().get(1);
	String content = null;
	assertTrue("javadoc has null content", javadoc != null && javadoc.getLeft() != null && (content = javadoc.getLeft()) != null);
	assertMatches("This link doesnt work LinkToSomethingNotFound", content);
}
 
Example 13
Source Project: lsp4j   Source File: HoverTypeAdapter.java    License: Eclipse Public License 2.0 6 votes vote down vote up
protected Either<List<Either<String, MarkedString>>, MarkupContent> readContents(final JsonReader in) throws IOException {
  final JsonToken nextToken = in.peek();
  boolean _equals = Objects.equal(nextToken, JsonToken.STRING);
  if (_equals) {
    final List<Either<String, MarkedString>> value = CollectionLiterals.<Either<String, MarkedString>>newArrayList(Either.<String, MarkedString>forLeft(in.nextString()));
    return Either.<List<Either<String, MarkedString>>, MarkupContent>forLeft(value);
  } else {
    boolean _equals_1 = Objects.equal(nextToken, JsonToken.BEGIN_ARRAY);
    if (_equals_1) {
      final List<Either<String, MarkedString>> value_1 = this.gson.<List<Either<String, MarkedString>>>fromJson(in, HoverTypeAdapter.LIST_STRING_MARKEDSTRING.getType());
      return Either.<List<Either<String, MarkedString>>, MarkupContent>forLeft(value_1);
    } else {
      JsonElement _parse = new JsonParser().parse(in);
      final JsonObject object = ((JsonObject) _parse);
      boolean _has = object.has("language");
      if (_has) {
        final List<Either<String, MarkedString>> value_2 = CollectionLiterals.<Either<String, MarkedString>>newArrayList(Either.<String, MarkedString>forRight(this.gson.<MarkedString>fromJson(object, MarkedString.class)));
        return Either.<List<Either<String, MarkedString>>, MarkupContent>forLeft(value_2);
      } else {
        return Either.<List<Either<String, MarkedString>>, MarkupContent>forRight(this.gson.<MarkupContent>fromJson(object, MarkupContent.class));
      }
    }
  }
}
 
Example 14
Source Project: groovy-language-server   Source File: HoverProvider.java    License: Apache License 2.0 5 votes vote down vote up
public CompletableFuture<Hover> provideHover(TextDocumentIdentifier textDocument, Position position) {
	Hover hover = new Hover();
	List<Either<String, MarkedString>> contents = new ArrayList<>();
	hover.setContents(contents);

	if (ast == null) {
		//this shouldn't happen, but let's avoid an exception if something
		//goes terribly wrong.
		return CompletableFuture.completedFuture(hover);
	}

	URI uri = URI.create(textDocument.getUri());
	ASTNode offsetNode = ast.getNodeAtLineAndColumn(uri, position.getLine(), position.getCharacter());
	if (offsetNode == null) {
		return CompletableFuture.completedFuture(hover);
	}

	ASTNode definitionNode = GroovyASTUtils.getDefinition(offsetNode, false, ast);
	if (definitionNode == null) {
		return CompletableFuture.completedFuture(hover);
	}

	String content = getContent(definitionNode);
	if (content == null) {
		return CompletableFuture.completedFuture(hover);
	}

	contents.add(Either.forRight(new MarkedString("groovy", content)));
	return CompletableFuture.completedFuture(hover);
}
 
Example 15
Source Project: intellij-quarkus   Source File: LSPTextHover.java    License: Eclipse Public License 2.0 5 votes vote down vote up
protected static @Nullable String getHoverString(Hover hover) {
    Either<List<Either<String, MarkedString>>, MarkupContent> hoverContent = hover.getContents();
    if (hoverContent.isLeft()) {
        List<Either<String, MarkedString>> contents = hoverContent.getLeft();
        if (contents == null || contents.isEmpty()) {
            return null;
        }
        return contents.stream().map(content -> {
            if (content.isLeft()) {
                return content.getLeft();
            } else if (content.isRight()) {
                MarkedString markedString = content.getRight();
                // TODO this won't work fully until markup parser will support syntax
                // highlighting but will help display
                // strings with language tags, e.g. without it things after <?php tag aren't
                // displayed
                if (markedString.getLanguage() != null && !markedString.getLanguage().isEmpty()) {
                    return String.format("```%s%n%s%n```", markedString.getLanguage(), markedString.getValue()); //$NON-NLS-1$
                } else {
                    return markedString.getValue();
                }
            } else {
                return ""; //$NON-NLS-1$
            }
        }).filter(((Predicate<String>) String::isEmpty).negate()).collect(Collectors.joining("\n\n")); //$NON-NLS-1$ )
    } else {
        return hoverContent.getRight().getValue();
    }
}
 
Example 16
Source Project: lemminx   Source File: XMLAssert.java    License: Eclipse Public License 2.0 5 votes vote down vote up
private static String getHoverLabel(Hover hover) {
	Either<List<Either<String, MarkedString>>, MarkupContent> contents = hover != null ? hover.getContents() : null;
	if (contents == null) {
		return null;
	}
	return contents.getRight().getValue();
}
 
Example 17
Source Project: n4js   Source File: StringLSP4J.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/** @return string for given element */
public String toString1(Either<List<Either<String, MarkedString>>, MarkupContent> contents) {
	if (contents == null) {
		return "";
	}
	if (contents.isLeft()) {
		List<Either<String, MarkedString>> markedStrings = contents.getLeft();
		return Strings.toString(this::toString2, markedStrings);

	} else {
		return toString(contents.getRight());
	}
}
 
Example 18
Source Project: n4js   Source File: StringLSP4J.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/** @return string for given element */
public String toString2(Either<String, MarkedString> ms) {
	if (ms == null) {
		return "";
	}
	if (ms.isLeft()) {
		return ms.getLeft();
	} else {
		return toString(ms.getRight());
	}
}
 
Example 19
Source Project: n4js   Source File: StringLSP4J.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/** @return string for given element */
public String toString(MarkedString markedStr) {
	if (markedStr == null) {
		return "";
	}
	return "[" + markedStr.getLanguage() + "] " + markedStr.getValue();
}
 
Example 20
Source Project: eclipse.jdt.ls   Source File: HoverHandler.java    License: Eclipse Public License 2.0 5 votes vote down vote up
public Hover hover(TextDocumentPositionParams position, IProgressMonitor monitor) {
	ITypeRoot unit = JDTUtils.resolveTypeRoot(position.getTextDocument().getUri());

	List<Either<String, MarkedString>> content = null;
	if (unit != null && !monitor.isCanceled()) {
		content = computeHover(unit, position.getPosition().getLine(), position.getPosition().getCharacter(), monitor);
	} else {
		content = Collections.singletonList(Either.forLeft(""));
	}
	Hover $ = new Hover();
	$.setContents(content);
	return $;
}
 
Example 21
Source Project: eclipse.jdt.ls   Source File: JavadocContentTest.java    License: Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testClassJavadoc() throws Exception {
	IType type = project.findType("org.sample.TestJavadoc");
	assertNotNull(type);
	MarkedString signature = HoverInfoProvider.computeSignature(type);
	assertEquals("org.sample.TestJavadoc", signature.getValue());
	MarkedString javadoc = HoverInfoProvider.computeJavadoc(type);
	assertEquals("Test javadoc class", javadoc.getValue());
}
 
Example 22
Source Project: eclipse.jdt.ls   Source File: JavadocContentTest.java    License: Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testFieldJavadoc() throws Exception {
	IType type = project.findType("org.sample.TestJavadoc");
	assertNotNull(type);
	IField field = type.getField("fooField");
	assertNotNull(field);
	MarkedString signature = HoverInfoProvider.computeSignature(field);
	assertEquals("int fooField", signature.getValue());
	MarkedString javadoc = HoverInfoProvider.computeJavadoc(field);
	assertEquals("Foo field", javadoc.getValue());
}
 
Example 23
Source Project: eclipse.jdt.ls   Source File: JavadocContentTest.java    License: Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testMethodJavadoc() throws Exception {
	IType type = project.findType("org.sample.TestJavadoc");
	assertNotNull(type);
	IMethod method = type.getMethod("foo", new String[0]);
	assertNotNull(method);
	MarkedString signature = HoverInfoProvider.computeSignature(method);
	assertEquals("String org.sample.TestJavadoc.foo()", signature.getValue());
	MarkedString javadoc = HoverInfoProvider.computeJavadoc(method);
	assertEquals("Foo method", javadoc.getValue());
}
 
Example 24
Source Project: eclipse.jdt.ls   Source File: HoverHandlerTest.java    License: Eclipse Public License 2.0 5 votes vote down vote up
private String getTitleHover(ICompilationUnit cu, int line, int character) {
	// when
	Hover hover = getHover(cu, line, character);

	// then
	assertNotNull(hover);
	MarkedString result = hover.getContents().getLeft().get(0).getRight();
	return result.getValue();
}
 
Example 25
Source Project: lsp4j   Source File: Hover.java    License: Eclipse Public License 2.0 5 votes vote down vote up
public void setContents(final List<Either<String, MarkedString>> contents) {
  if (contents == null) {
    Preconditions.checkNotNull(contents, "contents");
    this.contents = null;
    return;
  }
  this.contents = Either.forLeft(contents);
}
 
Example 26
Source Project: lsp4j   Source File: HoverTypeAdapter.java    License: Eclipse Public License 2.0 5 votes vote down vote up
protected void writeContents(final JsonWriter out, final Either<List<Either<String, MarkedString>>, MarkupContent> contents) throws IOException {
  boolean _isLeft = contents.isLeft();
  if (_isLeft) {
    final List<Either<String, MarkedString>> list = contents.getLeft();
    int _size = list.size();
    boolean _equals = (_size == 1);
    if (_equals) {
      this.gson.toJson(list.get(0), HoverTypeAdapter.STRING_MARKEDSTRING.getType(), out);
    } else {
      this.gson.toJson(list, HoverTypeAdapter.LIST_STRING_MARKEDSTRING.getType(), out);
    }
  } else {
    this.gson.toJson(contents.getRight(), MarkupContent.class, out);
  }
}
 
Example 27
Source Project: eclipse.jdt.ls   Source File: HoverHandler.java    License: Eclipse Public License 2.0 4 votes vote down vote up
private List<Either<String, MarkedString>> computeHover(ITypeRoot unit, int line, int column, IProgressMonitor monitor) {
	HoverInfoProvider provider = new HoverInfoProvider(unit, this.preferenceManager);
	return provider.computeHover(line, column, monitor);
}
 
Example 28
Source Project: eclipse.jdt.ls   Source File: HoverInfoProvider.java    License: Eclipse Public License 2.0 4 votes vote down vote up
private List<Either<String, MarkedString>> cancelled(List<Either<String, MarkedString>> res) {
	res.clear();
	res.add(Either.forLeft(""));
	return res;
}
 
Example 29
Source Project: eclipse.jdt.ls   Source File: HoverHandlerTest.java    License: Eclipse Public License 2.0 4 votes vote down vote up
@Test
public void testHoverOnJavadocWithMultipleDifferentTypesOfTags() throws Exception {
	importProjects("maven/salut");
	project = WorkspaceHelper.getProject("salut");
	handler = new HoverHandler(preferenceManager);
	//given
	String payload = createHoverRequest("src/main/java/java/Foo2.java", 44, 24);
	TextDocumentPositionParams position = getParams(payload);

	// when
	Hover hover = handler.hover(position, monitor);
	assertNotNull("Hover is null", hover);
	assertEquals("Unexpected hover contents:\n" + hover.getContents(), 2, hover.getContents().getLeft().size());
	Either<String, MarkedString> javadoc = hover.getContents().getLeft().get(1);
	String content = null;
	assertTrue("javadoc has null content", javadoc != null && javadoc.getLeft() != null && (content = javadoc.getLeft()) != null);

	//@formatter:off
	String expectedJavadoc =
			"This Javadoc contains a link to \\[newMethodBeingLinkedToo\\]\\(file:/.*/salut/src/main/java/java/Foo2.java#23\\)\n" +
			"\n" +
			" \\*  \\*\\*Parameters:\\*\\*\n" +
			"    \n" +
			"     \\*  \\*\\*someString\\*\\* the string to enter\n" +
			" \\*  \\*\\*Returns:\\*\\*\n" +
			"    \n" +
			"     \\*  String\n" +
			" \\*  \\*\\*Throws:\\*\\*\n" +
			"    \n" +
			"     \\*  IOException\n" +
			" \\*  \\*\\*Since:\\*\\*\n" +
			"    \n" +
			"     \\*  0.0.1\n" +
			" \\*  \\*\\*Version:\\*\\*\n" +
			"    \n" +
			"     \\*  0.0.1\n" +
			" \\*  \\*\\*Author:\\*\\*\n" +
			"    \n" +
			"     \\*  jpinkney\n" +
			" \\*  \\*\\*See Also:\\*\\*\n" +
			"    \n" +
			"     \\*  \\[Online docs for java\\]\\(https://docs.oracle.com/javase/7/docs/api/\\)\n" +
			" \\*  \\*\\*API Note:\\*\\*\n" +
			"    \n" +
			"     \\*  This is a note";

	//@formatter:on
	assertMatches(expectedJavadoc, content);
}
 
Example 30
Source Project: lsp4j   Source File: Hover.java    License: Eclipse Public License 2.0 4 votes vote down vote up
public Hover(@NonNull final List<Either<String, MarkedString>> contents) {
  this.setContents(Preconditions.<List<Either<String, MarkedString>>>checkNotNull(contents, "contents"));
}