void ShowMultipleDeclarations(Location[] locations)
 {
     using (var monitor = LanguageClientProgressMonitors.GetSearchProgressMonitor()) {
         List <SearchResult> references = locations.Select(CreateSearchResult).ToList();
         monitor.ReportResults(references);
     }
 }
        public async Task FindReferences(FilePath fileName, DocumentLocation location)
        {
            try {
                using (var monitor = LanguageClientProgressMonitors.GetSearchProgressMonitor()) {
                    Location[] locations = await session.GetReferences(
                        fileName,
                        location.CreatePosition(),
                        monitor.CancellationToken);

                    if (locations == null)
                    {
                        monitor.ReportResults(Enumerable.Empty <SearchResult> ());
                    }
                    else
                    {
                        List <SearchResult> references = ToSearchResults(locations).ToList();
                        monitor.ReportResults(references);
                    }
                }
            } catch (OperationCanceledException) {
                LanguageClientLoggingService.Log("Find references was canceled.");
            } catch (Exception ex) {
                LanguageClientLoggingService.LogError("FindReferences error.", ex);
            }
        }