Search in sources :

Example 1 with WorkspaceSymbolParamsDTO

use of org.eclipse.che.api.languageserver.shared.lsapi.WorkspaceSymbolParamsDTO in project che by eclipse.

the class FindSymbolAction method searchSymbols.

private Promise<List<SymbolEntry>> searchSymbols(final String value) {
    WorkspaceSymbolParamsDTO params = dtoFactory.createDto(WorkspaceSymbolParamsDTO.class);
    params.setQuery(value);
    params.setFileUri(editorAgent.getActiveEditor().getEditorInput().getFile().getLocation().toString());
    return workspaceServiceClient.symbol(params).then(new Function<List<SymbolInformationDTO>, List<SymbolEntry>>() {

        @Override
        public List<SymbolEntry> apply(List<SymbolInformationDTO> types) throws FunctionException {
            return toSymbolEntries(types, value);
        }
    });
}
Also used : SymbolInformationDTO(org.eclipse.che.api.languageserver.shared.lsapi.SymbolInformationDTO) FunctionException(org.eclipse.che.api.promises.client.FunctionException) WorkspaceSymbolParamsDTO(org.eclipse.che.api.languageserver.shared.lsapi.WorkspaceSymbolParamsDTO) ArrayList(java.util.ArrayList) Collections.singletonList(java.util.Collections.singletonList) List(java.util.List)

Aggregations

ArrayList (java.util.ArrayList)1 Collections.singletonList (java.util.Collections.singletonList)1 List (java.util.List)1 SymbolInformationDTO (org.eclipse.che.api.languageserver.shared.lsapi.SymbolInformationDTO)1 WorkspaceSymbolParamsDTO (org.eclipse.che.api.languageserver.shared.lsapi.WorkspaceSymbolParamsDTO)1 FunctionException (org.eclipse.che.api.promises.client.FunctionException)1