コード例 #1
0
        private bool TryGoToDefinition()
        {
            var point = _textView.Caret.Position.BufferPosition;

            var navigationServiceResult = ThreadHelper.JoinableTaskFactory.Run(() => _navigationService.GetNavigationsAsync(point));

            if (navigationServiceResult == null || navigationServiceResult.Values.Count == 0)
            {
                return(false);
            }

            _navigationService.NavigateOrOpenNavigationList(navigationServiceResult.Values);
            return(true);
        }
コード例 #2
0
        public async Task <INavigableSymbol> GetNavigableSymbolAsync(SnapshotSpan triggerSpan, CancellationToken token)
        {
            var triggerPoint = triggerSpan.Start;
            var tokensResult = await _navigationService.GetNavigationsAsync(triggerPoint);

            if (tokensResult == null)
            {
                return(null);
            }

            var snapshotSpan = new SnapshotSpan(triggerPoint.Snapshot, tokensResult.ApplicableToken.Span);

            return(new NavigableSymbol(snapshotSpan,
                                       () => _navigationService.NavigateOrOpenNavigationList(tokensResult.Values)));
        }