Data query parameter go to definition, doc highlights and inlay hints
This commit is contained in:
@@ -41,6 +41,7 @@ import org.eclipse.lsp4j.CompletionItemTag;
|
||||
import org.eclipse.lsp4j.CompletionList;
|
||||
import org.eclipse.lsp4j.DefinitionParams;
|
||||
import org.eclipse.lsp4j.Diagnostic;
|
||||
import org.eclipse.lsp4j.DocumentHighlight;
|
||||
import org.eclipse.lsp4j.DocumentSymbol;
|
||||
import org.eclipse.lsp4j.Hover;
|
||||
import org.eclipse.lsp4j.InsertReplaceEdit;
|
||||
@@ -240,6 +241,15 @@ public class Editor {
|
||||
assertEquals(ImmutableList.copyOf(expectedHighlights), actualHighlights);
|
||||
return ranges;
|
||||
}
|
||||
|
||||
public void assertDocumentHighlights(String afterString, DocumentHighlight... expected) throws Exception {
|
||||
int pos = getRawText().indexOf(afterString);
|
||||
if (pos>=0) {
|
||||
pos += afterString.length();
|
||||
}
|
||||
List<? extends DocumentHighlight> actual = harness.getDocumentHighlights(doc.getId(), doc.toPosition(pos));
|
||||
assertEquals(ImmutableList.copyOf(expected), actual);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the editor text, with cursor markers inserted (for easy textual comparison
|
||||
|
||||
@@ -35,6 +35,7 @@ import java.util.Map.Entry;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -65,6 +66,8 @@ import org.eclipse.lsp4j.DidChangeTextDocumentParams;
|
||||
import org.eclipse.lsp4j.DidChangeWatchedFilesParams;
|
||||
import org.eclipse.lsp4j.DidCloseTextDocumentParams;
|
||||
import org.eclipse.lsp4j.DidOpenTextDocumentParams;
|
||||
import org.eclipse.lsp4j.DocumentHighlight;
|
||||
import org.eclipse.lsp4j.DocumentHighlightParams;
|
||||
import org.eclipse.lsp4j.DocumentSymbol;
|
||||
import org.eclipse.lsp4j.DocumentSymbolCapabilities;
|
||||
import org.eclipse.lsp4j.DocumentSymbolParams;
|
||||
@@ -679,6 +682,9 @@ public class LanguageServerHarness {
|
||||
return getServer().getTextDocumentService().codeLens(params).get();
|
||||
}
|
||||
|
||||
public List<? extends DocumentHighlight> getDocumentHighlights(TextDocumentIdentifier docId, Position cursor) throws InterruptedException, ExecutionException {
|
||||
return getServer().getTextDocumentService().documentHighlight(new DocumentHighlightParams(docId, cursor)).get();
|
||||
}
|
||||
|
||||
public CompletionItem resolveCompletionItem(CompletionItem maybeUnresolved) {
|
||||
if (getServer().hasLazyCompletionResolver()) {
|
||||
|
||||
Reference in New Issue
Block a user