public async Task OpenDeclaration(FilePath fileName, DocumentLocation location) { ProgressMonitor monitor = null; try { using (monitor = LanguageClientProgressMonitors.GetOpenDeclarationProgressMonitor()) { Location[] locations = await session.FindDefinitions( fileName, location.CreatePosition(), monitor.CancellationToken); if (locations == null || locations.Length == 0) { monitor.ReportNoDeclarationFound(); } else if (locations.Length == 1) { OpenDeclaration(locations [0]); } else { ShowMultipleDeclarations(locations); } } } catch (OperationCanceledException) { LanguageClientLoggingService.Log("Go to declaration canceled."); if (monitor != null) { monitor.ReportGoToDeclarationCanceled(); } } catch (Exception ex) { LanguageClientLoggingService.LogError("OpenDeclaration error.", ex); } }