fixed reference provider for properties in value annotations
This commit is contained in:
@@ -43,6 +43,7 @@ import org.eclipse.lsp4j.Diagnostic;
|
||||
import org.eclipse.lsp4j.DocumentSymbol;
|
||||
import org.eclipse.lsp4j.Hover;
|
||||
import org.eclipse.lsp4j.InsertReplaceEdit;
|
||||
import org.eclipse.lsp4j.Location;
|
||||
import org.eclipse.lsp4j.LocationLink;
|
||||
import org.eclipse.lsp4j.MarkedString;
|
||||
import org.eclipse.lsp4j.MarkupContent;
|
||||
@@ -571,6 +572,11 @@ public class Editor {
|
||||
});
|
||||
return items;
|
||||
}
|
||||
|
||||
public List<? extends Location> getReferences() throws Exception {
|
||||
List<? extends Location> references = harness.getReferences(this.doc, this.getCursor());
|
||||
return references;
|
||||
}
|
||||
|
||||
public CompletionItem getFirstCompletion() throws Exception {
|
||||
return getCompletions().get(0);
|
||||
|
||||
@@ -84,6 +84,7 @@ import org.eclipse.lsp4j.MessageParams;
|
||||
import org.eclipse.lsp4j.Position;
|
||||
import org.eclipse.lsp4j.PublishDiagnosticsParams;
|
||||
import org.eclipse.lsp4j.Range;
|
||||
import org.eclipse.lsp4j.ReferenceParams;
|
||||
import org.eclipse.lsp4j.RegistrationParams;
|
||||
import org.eclipse.lsp4j.RenameFile;
|
||||
import org.eclipse.lsp4j.ResourceOperation;
|
||||
@@ -649,6 +650,15 @@ public class LanguageServerHarness {
|
||||
}
|
||||
}
|
||||
|
||||
public List<? extends Location> getReferences(TextDocumentInfo doc, Position cursor) throws Exception {
|
||||
ReferenceParams params = new ReferenceParams();
|
||||
params.setPosition(cursor);
|
||||
params.setTextDocument(doc.getId());
|
||||
waitForReconcile();
|
||||
List<? extends Location> references = getServer().getTextDocumentService().references(params).get();
|
||||
return references;
|
||||
}
|
||||
|
||||
private void waitForReconcile() throws Exception {
|
||||
getServer().getAsync().waitForAll();
|
||||
getServer().waitForReconcile();
|
||||
|
||||
Reference in New Issue
Block a user