本文整理汇总了Java中org.eclipse.xtext.xbase.lib.CollectionLiterals.emptyList方法的典型用法代码示例。如果您正苦于以下问题:Java CollectionLiterals.emptyList方法的具体用法?Java CollectionLiterals.emptyList怎么用?Java CollectionLiterals.emptyList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.xtext.xbase.lib.CollectionLiterals
的用法示例。
在下文中一共展示了CollectionLiterals.emptyList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getReferences
import org.eclipse.xtext.xbase.lib.CollectionLiterals; //导入方法依赖的package包/类
public List<? extends Location> getReferences(final XtextResource resource, final int offset, final IReferenceFinder.IResourceAccess resourceAccess, final IResourceDescriptions indexData, final CancelIndicator cancelIndicator) {
final EObject element = this._eObjectAtOffsetHelper.resolveElementAt(resource, offset);
if ((element == null)) {
return CollectionLiterals.<Location>emptyList();
}
final ArrayList<Location> locations = CollectionLiterals.<Location>newArrayList();
final TargetURIs targetURIs = this.collectTargetURIs(element);
final IAcceptor<IReferenceDescription> _function = (IReferenceDescription reference) -> {
final Procedure1<EObject> _function_1 = (EObject obj) -> {
final Location location = this._documentExtensions.newLocation(obj, reference.getEReference(), reference.getIndexInList());
if ((location != null)) {
locations.add(location);
}
};
this.doRead(resourceAccess, reference.getSourceEObjectUri(), _function_1);
};
ReferenceAcceptor _referenceAcceptor = new ReferenceAcceptor(this.resourceServiceProviderRegistry, _function);
CancelIndicatorProgressMonitor _cancelIndicatorProgressMonitor = new CancelIndicatorProgressMonitor(cancelIndicator);
this.referenceFinder.findAllReferences(targetURIs, resourceAccess, indexData, _referenceAcceptor, _cancelIndicatorProgressMonitor);
return locations;
}
示例2: findAllFeatures
import org.eclipse.xtext.xbase.lib.CollectionLiterals; //导入方法依赖的package包/类
public Iterable<JvmFeature> findAllFeatures(final XImportDeclaration it) {
Iterable<JvmFeature> _xblockexpression = null;
{
final JvmDeclaredType importedType = it.getImportedType();
if (((!it.isStatic()) || (importedType == null))) {
return CollectionLiterals.<JvmFeature>emptyList();
}
final IVisibilityHelper visibilityHelper = this.getVisibilityHelper(it.eResource());
final IResolvedFeatures resolvedFeatures = this._provider.getResolvedFeatures(importedType);
final Function1<JvmFeature, Boolean> _function = (JvmFeature feature) -> {
return Boolean.valueOf(((feature.isStatic() && visibilityHelper.isVisible(feature)) && ((it.getMemberName() == null) || feature.getSimpleName().startsWith(it.getMemberName()))));
};
_xblockexpression = IterableExtensions.<JvmFeature>filter(resolvedFeatures.getAllFeatures(), _function);
}
return _xblockexpression;
}
示例3: initialHiddenTokens
import org.eclipse.xtext.xbase.lib.CollectionLiterals; //导入方法依赖的package包/类
public List<String> initialHiddenTokens(final Grammar it) {
List<String> _xblockexpression = null;
{
boolean _isDefinesHiddenTokens = it.isDefinesHiddenTokens();
if (_isDefinesHiddenTokens) {
final Function1<AbstractRule, String> _function = (AbstractRule it_1) -> {
return this.ruleName(it_1);
};
return IterableExtensions.<String>toList(ListExtensions.<AbstractRule, String>map(it.getHiddenTokens(), _function));
}
int _size = it.getUsedGrammars().size();
boolean _equals = (_size == 1);
if (_equals) {
return this.initialHiddenTokens(IterableExtensions.<Grammar>head(it.getUsedGrammars()));
}
_xblockexpression = CollectionLiterals.<String>emptyList();
}
return _xblockexpression;
}
示例4: definition
import org.eclipse.xtext.xbase.lib.CollectionLiterals; //导入方法依赖的package包/类
protected List<? extends Location> definition(final CancelIndicator cancelIndicator, final TextDocumentPositionParams params) {
final URI uri = this._uriExtensions.toUri(params.getTextDocument().getUri());
final IResourceServiceProvider resourceServiceProvider = this.languagesRegistry.getResourceServiceProvider(uri);
DocumentSymbolService _get = null;
if (resourceServiceProvider!=null) {
_get=resourceServiceProvider.<DocumentSymbolService>get(DocumentSymbolService.class);
}
final DocumentSymbolService documentSymbolService = _get;
if ((documentSymbolService == null)) {
return CollectionLiterals.<Location>emptyList();
}
final Function2<Document, XtextResource, List<? extends Location>> _function = (Document document, XtextResource resource) -> {
return documentSymbolService.getDefinitions(document, resource, params, this.resourceAccess, cancelIndicator);
};
return this.workspaceManager.<List<? extends Location>>doRead(uri, _function);
}
示例5: references
import org.eclipse.xtext.xbase.lib.CollectionLiterals; //导入方法依赖的package包/类
@Override
public CompletableFuture<List<? extends Location>> references(final ReferenceParams params) {
final Function1<CancelIndicator, List<? extends Location>> _function = (CancelIndicator cancelIndicator) -> {
final URI uri = this._uriExtensions.toUri(params.getTextDocument().getUri());
final IResourceServiceProvider resourceServiceProvider = this.languagesRegistry.getResourceServiceProvider(uri);
DocumentSymbolService _get = null;
if (resourceServiceProvider!=null) {
_get=resourceServiceProvider.<DocumentSymbolService>get(DocumentSymbolService.class);
}
final DocumentSymbolService documentSymbolService = _get;
if ((documentSymbolService == null)) {
return CollectionLiterals.<Location>emptyList();
}
final Function2<Document, XtextResource, List<? extends Location>> _function_1 = (Document document, XtextResource resource) -> {
return documentSymbolService.getReferences(document, resource, params, this.resourceAccess, this.workspaceManager.getIndex(), cancelIndicator);
};
return this.workspaceManager.<List<? extends Location>>doRead(uri, _function_1);
};
return this.requestManager.<List<? extends Location>>runRead(_function);
}
示例6: documentSymbol
import org.eclipse.xtext.xbase.lib.CollectionLiterals; //导入方法依赖的package包/类
@Override
public CompletableFuture<List<? extends SymbolInformation>> documentSymbol(final DocumentSymbolParams params) {
final Function1<CancelIndicator, List<? extends SymbolInformation>> _function = (CancelIndicator cancelIndicator) -> {
final URI uri = this._uriExtensions.toUri(params.getTextDocument().getUri());
final IResourceServiceProvider resourceServiceProvider = this.languagesRegistry.getResourceServiceProvider(uri);
DocumentSymbolService _get = null;
if (resourceServiceProvider!=null) {
_get=resourceServiceProvider.<DocumentSymbolService>get(DocumentSymbolService.class);
}
final DocumentSymbolService documentSymbolService = _get;
if ((documentSymbolService == null)) {
return CollectionLiterals.<SymbolInformation>emptyList();
}
final Function2<Document, XtextResource, List<? extends SymbolInformation>> _function_1 = (Document document, XtextResource resource) -> {
return documentSymbolService.getSymbols(document, resource, params, cancelIndicator);
};
return this.workspaceManager.<List<? extends SymbolInformation>>doRead(uri, _function_1);
};
return this.requestManager.<List<? extends SymbolInformation>>runRead(_function);
}
示例7: buildChildren
import org.eclipse.xtext.xbase.lib.CollectionLiterals; //导入方法依赖的package包/类
@Override
public Collection<IHierarchyNode> buildChildren(final IHierarchyNode parent, final IProgressMonitor monitor) {
boolean _mayHaveChildren = parent.mayHaveChildren();
boolean _not = (!_mayHaveChildren);
if (_not) {
return CollectionLiterals.<IHierarchyNode>emptyList();
}
final LinkedHashMap<URI, IHierarchyNode> children = CollectionLiterals.<URI, IHierarchyNode>newLinkedHashMap();
final Procedure2<IEObjectDescription, IReferenceDescription> _function = (IEObjectDescription declaration, IReferenceDescription reference) -> {
final IHierarchyNode childNode = this.createChild(children, declaration, parent);
if ((childNode != null)) {
final IHierarchyNodeReference nodeReference = this.createNodeReference(reference);
if ((nodeReference != null)) {
Collection<IHierarchyNodeReference> _references = childNode.getReferences();
_references.add(nodeReference);
}
}
};
this.findDeclarations(parent, monitor, _function);
return children.values();
}
示例8: codeAction
import org.eclipse.xtext.xbase.lib.CollectionLiterals; //导入方法依赖的package包/类
@Override
public CompletableFuture<List<? extends Command>> codeAction(final CodeActionParams params) {
final Function1<CancelIndicator, List<? extends Command>> _function = (CancelIndicator cancelIndicator) -> {
final URI uri = this._uriExtensions.toUri(params.getTextDocument().getUri());
final IResourceServiceProvider serviceProvider = this.languagesRegistry.getResourceServiceProvider(uri);
ICodeActionService _get = null;
if (serviceProvider!=null) {
_get=serviceProvider.<ICodeActionService>get(ICodeActionService.class);
}
final ICodeActionService service = _get;
if ((service == null)) {
return CollectionLiterals.<Command>emptyList();
}
final Function2<Document, XtextResource, List<? extends Command>> _function_1 = (Document doc, XtextResource resource) -> {
return service.getCodeActions(doc, resource, params, cancelIndicator);
};
return this.workspaceManager.<List<? extends Command>>doRead(uri, _function_1);
};
return this.requestManager.<List<? extends Command>>runRead(_function);
}
示例9: codeLens
import org.eclipse.xtext.xbase.lib.CollectionLiterals; //导入方法依赖的package包/类
@Override
public CompletableFuture<List<? extends CodeLens>> codeLens(final CodeLensParams params) {
final Function1<CancelIndicator, List<? extends CodeLens>> _function = (CancelIndicator cancelIndicator) -> {
final URI uri = this._uriExtensions.toUri(params.getTextDocument().getUri());
final IResourceServiceProvider resourceServiceProvider = this.languagesRegistry.getResourceServiceProvider(uri);
ICodeLensService _get = null;
if (resourceServiceProvider!=null) {
_get=resourceServiceProvider.<ICodeLensService>get(ICodeLensService.class);
}
final ICodeLensService codeLensService = _get;
if ((codeLensService == null)) {
return CollectionLiterals.<CodeLens>emptyList();
}
final Function2<Document, XtextResource, List<? extends CodeLens>> _function_1 = (Document document, XtextResource resource) -> {
final List<? extends CodeLens> result = codeLensService.computeCodeLenses(document, resource, params, cancelIndicator);
this.installURI(result, uri.toString());
return result;
};
return this.workspaceManager.<List<? extends CodeLens>>doRead(uri, _function_1);
};
return this.requestManager.<List<? extends CodeLens>>runRead(_function);
}
示例10: formatting
import org.eclipse.xtext.xbase.lib.CollectionLiterals; //导入方法依赖的package包/类
@Override
public CompletableFuture<List<? extends TextEdit>> formatting(final DocumentFormattingParams params) {
final Function1<CancelIndicator, List<? extends TextEdit>> _function = (CancelIndicator cancelIndicator) -> {
final URI uri = this._uriExtensions.toUri(params.getTextDocument().getUri());
final IResourceServiceProvider resourceServiceProvider = this.languagesRegistry.getResourceServiceProvider(uri);
FormattingService _get = null;
if (resourceServiceProvider!=null) {
_get=resourceServiceProvider.<FormattingService>get(FormattingService.class);
}
final FormattingService formatterService = _get;
if ((formatterService == null)) {
return CollectionLiterals.<TextEdit>emptyList();
}
final Function2<Document, XtextResource, List<? extends TextEdit>> _function_1 = (Document document, XtextResource resource) -> {
return formatterService.format(document, resource, params, cancelIndicator);
};
return this.workspaceManager.<List<? extends TextEdit>>doRead(uri, _function_1);
};
return this.requestManager.<List<? extends TextEdit>>runRead(_function);
}
示例11: rangeFormatting
import org.eclipse.xtext.xbase.lib.CollectionLiterals; //导入方法依赖的package包/类
@Override
public CompletableFuture<List<? extends TextEdit>> rangeFormatting(final DocumentRangeFormattingParams params) {
final Function1<CancelIndicator, List<? extends TextEdit>> _function = (CancelIndicator cancelIndicator) -> {
final URI uri = this._uriExtensions.toUri(params.getTextDocument().getUri());
final IResourceServiceProvider resourceServiceProvider = this.languagesRegistry.getResourceServiceProvider(uri);
FormattingService _get = null;
if (resourceServiceProvider!=null) {
_get=resourceServiceProvider.<FormattingService>get(FormattingService.class);
}
final FormattingService formatterService = _get;
if ((formatterService == null)) {
return CollectionLiterals.<TextEdit>emptyList();
}
final Function2<Document, XtextResource, List<? extends TextEdit>> _function_1 = (Document document, XtextResource resource) -> {
return formatterService.format(document, resource, params, cancelIndicator);
};
return this.workspaceManager.<List<? extends TextEdit>>doRead(uri, _function_1);
};
return this.requestManager.<List<? extends TextEdit>>runRead(_function);
}
示例12: surround
import org.eclipse.xtext.xbase.lib.CollectionLiterals; //导入方法依赖的package包/类
public Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> surround(final INode node, final Procedure1<? super FormattingDataInit> init) {
final Function1<FormattableDocument, Iterable<FormattingData>> _function = (FormattableDocument doc) -> {
ArrayList<FormattingData> _xblockexpression = null;
{
final ArrayList<FormattingData> result = CollectionLiterals.<FormattingData>newArrayList();
if ((node != null)) {
Iterable<FormattingData> _elvis = null;
Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> _newFormattingData = this.newFormattingData(this._hiddenLeafAccess.getHiddenLeafsBefore(node), init);
Iterable<FormattingData> _apply = null;
if (_newFormattingData!=null) {
_apply=_newFormattingData.apply(doc);
}
if (_apply != null) {
_elvis = _apply;
} else {
List<FormattingData> _emptyList = CollectionLiterals.<FormattingData>emptyList();
_elvis = _emptyList;
}
Iterables.<FormattingData>addAll(result, _elvis);
Iterable<FormattingData> _elvis_1 = null;
Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> _newFormattingData_1 = this.newFormattingData(this._hiddenLeafAccess.getHiddenLeafsAfter(node), init);
Iterable<FormattingData> _apply_1 = null;
if (_newFormattingData_1!=null) {
_apply_1=_newFormattingData_1.apply(doc);
}
if (_apply_1 != null) {
_elvis_1 = _apply_1;
} else {
List<FormattingData> _emptyList_1 = CollectionLiterals.<FormattingData>emptyList();
_elvis_1 = _emptyList_1;
}
Iterables.<FormattingData>addAll(result, _elvis_1);
}
_xblockexpression = result;
}
return _xblockexpression;
};
return _function;
}
示例13: format
import org.eclipse.xtext.xbase.lib.CollectionLiterals; //导入方法依赖的package包/类
public List<? extends TextEdit> format(final Document document, final XtextResource resource, final DocumentFormattingParams params, final CancelIndicator cancelIndicator) {
final int offset = 0;
final int length = document.getContents().length();
if (((length == 0) || resource.getContents().isEmpty())) {
return CollectionLiterals.<TextEdit>emptyList();
}
return this.format(resource, document, offset, length);
}
示例14: getImportedNames
import org.eclipse.xtext.xbase.lib.CollectionLiterals; //导入方法依赖的package包/类
@Override
public Iterable<QualifiedName> getImportedNames() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("getImportedNames ");
_builder.append(this.URI);
IllegalStateException exception = new IllegalStateException(_builder.toString());
Indexer.ResolvedResourceDescription.LOG.error(exception, exception);
return CollectionLiterals.<QualifiedName>emptyList();
}
示例15: getReferenceDescriptions
import org.eclipse.xtext.xbase.lib.CollectionLiterals; //导入方法依赖的package包/类
@Override
public Iterable<IReferenceDescription> getReferenceDescriptions() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("getReferenceDescriptions ");
_builder.append(this.URI);
IllegalStateException exception = new IllegalStateException(_builder.toString());
Indexer.ResolvedResourceDescription.LOG.error(exception, exception);
return CollectionLiterals.<IReferenceDescription>emptyList();
}