Search in sources :

Example 41 with Hover

use of org.eclipse.lsp4j.Hover in project sts4 by spring-projects.

the class Editor method assertHoverText.

/**
 * Verifies an expected textSnippet is contained in the hover text that is
 * computed when hovering mouse at position at the end of first occurrence of
 * a given string in the editor.
 */
public void assertHoverText(String afterString, String expectSnippet) throws Exception {
    int pos = getRawText().indexOf(afterString);
    if (pos >= 0) {
        pos += afterString.length();
    }
    Hover hover = harness.getHover(doc, doc.toPosition(pos));
    assertContains(expectSnippet, hoverString(hover));
}
Also used : Hover(org.eclipse.lsp4j.Hover)

Aggregations

Hover (org.eclipse.lsp4j.Hover)41 MarkedString (org.eclipse.lsp4j.MarkedString)14 Test (org.junit.Test)12 AbstractProjectsManagerBasedTest (org.eclipse.jdt.ls.core.internal.managers.AbstractProjectsManagerBasedTest)11 TextDocumentPositionParams (org.eclipse.lsp4j.TextDocumentPositionParams)11 ArrayList (java.util.ArrayList)10 Either (org.eclipse.lsp4j.jsonrpc.messages.Either)10 Range (org.eclipse.lsp4j.Range)5 SpringBootApp (org.springframework.ide.vscode.commons.boot.app.cli.SpringBootApp)5 List (java.util.List)4 Position (org.eclipse.lsp4j.Position)3 LiveBean (org.springframework.ide.vscode.commons.boot.app.cli.livebean.LiveBean)3 LiveBeansModel (org.springframework.ide.vscode.commons.boot.app.cli.livebean.LiveBeansModel)3 File (java.io.File)2 URI (java.net.URI)2 IDefinition (org.apache.flex.compiler.definitions.IDefinition)2 PositionTreeVisitor (org.ballerinalang.langserver.common.position.PositionTreeVisitor)2 IClassFile (org.eclipse.jdt.core.IClassFile)2 TextDocumentIdentifier (org.eclipse.lsp4j.TextDocumentIdentifier)2 SimpleTextDocumentService (org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService)2