private void addSymbol(BLangNode node, BSymbol balSymbol, SymbolKind kind) { String symbolName = balSymbol.getName().getValue(); if (query != null && !query.isEmpty() && !symbolName.startsWith(query)) { return; } SymbolInformation lspSymbol = new SymbolInformation(); lspSymbol.setName(symbolName); lspSymbol.setKind(kind); lspSymbol.setLocation(new Location(this.uri, getRange(node))); this.symbols.add(lspSymbol); }
protected SymbolInformation createSymbol(final IEObjectDescription description) { final String symbolName = this.getSymbolName(description); if ((symbolName == null)) { return null; } final SymbolKind symbolKind = this.getSymbolKind(description); if ((symbolKind == null)) { return null; } final SymbolInformation symbol = new SymbolInformation(); symbol.setName(symbolName); symbol.setKind(symbolKind); return symbol; }
protected SymbolInformation createSymbol(final EObject object) { final String name = this.getSymbolName(object); if ((name == null)) { return null; } final SymbolKind kind = this.getSymbolKind(object); if ((kind == null)) { return null; } final Location location = this.getSymbolLocation(object); if ((location == null)) { return null; } final SymbolInformation symbol = new SymbolInformation(); symbol.setName(name); symbol.setKind(kind); symbol.setLocation(location); return symbol; }
String name = JavaElementLabels.getElementLabel(element, JavaElementLabels.ALL_DEFAULT); si.setName(name == null ? element.getElementName() : name); si.setKind(mapKind(element)); if (element.getParent() != null) { si.setContainerName(element.getParent().getElementName());
protected SymbolInformation createSymbol(TextDocument doc, Node node, YType type) throws BadLocationException { DocumentRegion region = NodeUtil.region(doc, node); Location location = new Location(doc.getUri(), doc.toRange(region.getStart(), region.getLength())); SymbolInformation symbol = new SymbolInformation(); symbol.setName(region.toString()); symbol.setKind(symbolKind(type)); symbol.setLocation(location); symbol.setContainerName(containerName(type)); return symbol; }
@Override public void acceptTypeNameMatch(TypeNameMatch match) { SymbolInformation symbolInformation = new SymbolInformation(); symbolInformation.setContainerName(match.getTypeContainerName()); symbolInformation.setName(match.getSimpleTypeName()); symbolInformation.setKind(mapKind(match)); Location location; try { if (match.getType().isBinary()) { location = JDTUtils.toLocation(match.getType().getClassFile()); } else { location = JDTUtils.toLocation(match.getType()); } } catch (Exception e) { JavaLanguageServerPlugin.logException("Unable to determine location for " + match.getSimpleTypeName(), e); return; } symbolInformation.setLocation(location); symbols.add(symbolInformation); }
/** * @since 2.16 */ protected SymbolInformation createSymbol(final String uri, final DocumentSymbol symbol, final Function1<? super DocumentSymbol, ? extends String> containerNameProvider) { SymbolInformation _symbolInformation = new SymbolInformation(); final Procedure1<SymbolInformation> _function = (SymbolInformation it) -> { it.setName(symbol.getName()); it.setKind(symbol.getKind()); it.setDeprecated(symbol.getDeprecated()); Location _location = new Location(); final Procedure1<Location> _function_1 = (Location it_1) -> { it_1.setUri(uri); it_1.setRange(symbol.getSelectionRange()); }; Location _doubleArrow = ObjectExtensions.<Location>operator_doubleArrow(_location, _function_1); it.setLocation(_doubleArrow); it.setContainerName(containerNameProvider.apply(symbol)); }; return ObjectExtensions.<SymbolInformation>operator_doubleArrow(_symbolInformation, _function); }
final Procedure1<SymbolInformation> _function_2 = (SymbolInformation it_1) -> { it_1.setName("foobar"); it_1.setKind(SymbolKind.Constructor); Location _location = new Location(); final Procedure1<Location> _function_3 = (Location it_2) -> {