Java Code Examples for org.eclipse.lsp4j.SymbolInformation#setDeprecated()
The following examples show how to use
org.eclipse.lsp4j.SymbolInformation#setDeprecated() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DocumentSymbolService.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
/** * @since 2.16 */ protected SymbolInformation createSymbol(String uri, DocumentSymbol symbol, Function1<? super DocumentSymbol, ? extends String> containerNameProvider) { SymbolInformation symbolInformation = new SymbolInformation(); symbolInformation.setName(symbol.getName()); symbolInformation.setKind(symbol.getKind()); symbolInformation.setDeprecated(symbol.getDeprecated()); Location location = new Location(); location.setUri(uri); location.setRange(symbol.getSelectionRange()); symbolInformation.setLocation(location); symbolInformation.setContainerName(containerNameProvider.apply(symbol)); return symbolInformation; }
Example 2
Source File: SymbolInformationTypeAdapter.java From lsp4j with Eclipse Public License 2.0 | 5 votes |
public SymbolInformation read(final JsonReader in) throws IOException { JsonToken nextToken = in.peek(); if (nextToken == JsonToken.NULL) { return null; } SymbolInformation result = new SymbolInformation(); in.beginObject(); while (in.hasNext()) { String name = in.nextName(); switch (name) { case "name": result.setName(readName(in)); break; case "kind": result.setKind(readKind(in)); break; case "deprecated": result.setDeprecated(readDeprecated(in)); break; case "location": result.setLocation(readLocation(in)); break; case "containerName": result.setContainerName(readContainerName(in)); break; default: in.skipValue(); } } in.endObject(); return result; }
Example 3
Source File: WorkspaceFolderManager.java From vscode-as3mxml with Apache License 2.0 | 4 votes |
public SymbolInformation definitionToSymbolInformation(IDefinition definition, ILspProject project) { String definitionBaseName = definition.getBaseName(); if (definitionBaseName.length() == 0) { //vscode expects all items to have a name return null; } Location location = getLocationFromDefinition(definition, project); if (location == null) { //we can't find where the source code for this symbol is located return null; } SymbolInformation symbol = new SymbolInformation(); symbol.setKind(LanguageServerCompilerUtils.getSymbolKindFromDefinition(definition)); if (!definition.getQualifiedName().equals(definitionBaseName)) { symbol.setContainerName(definition.getPackageName()); } else if (definition instanceof ITypeDefinition) { symbol.setContainerName("No Package"); } else { IDefinition parentDefinition = definition.getParent(); if (parentDefinition != null) { symbol.setContainerName(parentDefinition.getQualifiedName()); } } symbol.setName(definitionBaseName); symbol.setLocation(location); IDeprecationInfo deprecationInfo = definition.getDeprecationInfo(); if (deprecationInfo != null) { symbol.setDeprecated(true); } return symbol; }