public List<? extends Location> getReferences(final Document document, final XtextResource resource, final ReferenceParams params, final IReferenceFinder.IResourceAccess resourceAccess, final IResourceDescriptions indexData, final CancelIndicator cancelIndicator) { final int offset = document.getOffSet(params.getPosition()); List<? extends Location> _xifexpression = null; boolean _isIncludeDeclaration = params.getContext().isIncludeDeclaration(); if (_isIncludeDeclaration) { _xifexpression = this.getDefinitions(resource, offset, resourceAccess, cancelIndicator); } else { _xifexpression = CollectionLiterals.emptyList(); } final List<? extends Location> definitions = _xifexpression; final List<? extends Location> references = this.getReferences(resource, offset, resourceAccess, indexData, cancelIndicator); final Iterable<Location> result = Iterables.<Location>concat(definitions, references); return IterableExtensions.<Location>toList(result); }
.map(symbol -> symbol.getLocation()) .filter(loc -> Ranges.isValid(loc.getRange()) && Ranges.contains(loc.getRange(), params.getPosition())) .map(loc -> new ReferenceLocation(loc, false)) .collect(Collectors.toList()); .filter(loc -> paramsUri.toString().equals(loc.getUri()) && Ranges.isValid(loc.getRange()) && Ranges.contains(loc.getRange(), params.getPosition()) && indexer.gotoReferenced(loc).isPresent()) .map(loc -> new ReferenceLocation(loc, true))
IJavaElement elementToSearch = JDTUtils.findElementAtSelection(JDTUtils.resolveTypeRoot(param.getTextDocument().getUri()), param.getPosition().getLine(), param.getPosition().getCharacter(), this.preferenceManager, monitor);
@Override @Pure public String toString() { ToStringBuilder b = new ToStringBuilder(this); b.add("context", this.context); b.add("textDocument", getTextDocument()); b.add("uri", getUri()); b.add("position", getPosition()); return b.toString(); }
@Override @Pure public String toString() { ToStringBuilder b = new ToStringBuilder(this); b.add("context", this.context); b.add("textDocument", getTextDocument()); b.add("uri", getUri()); b.add("position", getPosition()); return b.toString(); }
ReferenceParams clone(ReferenceParams referenceParams) { if (referenceParams == null) { return null; } ReferenceContext context = referenceParams.getContext(); Position position = referenceParams.getPosition(); TextDocumentIdentifier textDocument = referenceParams.getTextDocument(); ReferenceParams cloned = new ReferenceParams(); cloned.setContext(clone(context)); cloned.setPosition(clone(position)); cloned.setTextDocument(clone(textDocument)); return cloned; }
public ReferenceParamsDto(org.eclipse.lsp4j.ReferenceParams o) { if (o.getContext() == null) { setContext((org.eclipse.lsp4j.ReferenceContext)null); } else { org.eclipse.lsp4j.ReferenceContext contextVal = new ReferenceContextDto(o.getContext()); setContext((org.eclipse.lsp4j.ReferenceContext)contextVal); } if (o.getPosition() == null) { setPosition((org.eclipse.lsp4j.Position)null); } else { org.eclipse.lsp4j.Position positionVal = new PositionDto(o.getPosition()); setPosition((org.eclipse.lsp4j.Position)positionVal); } if (o.getUri() == null) { setUri((java.lang.String)null); } else { java.lang.String uriVal = (java.lang.String)makeDto(o.getUri());; setUri((java.lang.String)uriVal); } if (o.getTextDocument() == null) { setTextDocument((org.eclipse.lsp4j.TextDocumentIdentifier)null); } else { org.eclipse.lsp4j.TextDocumentIdentifier textDocumentVal = new TextDocumentIdentifierDto(o.getTextDocument()); setTextDocument((org.eclipse.lsp4j.TextDocumentIdentifier)textDocumentVal); } }