Пример #1
0
        internal void GotoDefn(SnapshotPoint point)
        {
            CheckDisposed();
            var fileModel = FileModel;
            var client    = fileModel.Server.Client;

            foreach (var projectId in fileModel.GetProjectIds())
            {
                var pos = point.ToVersionedPos();
                client.Send(new ClientMessage.FindSymbolDefinitions(projectId, fileModel.Id, pos));
                break;
            }

            var msg = client.Receive <ServerMessage.FindSymbolDefinitions>();
            var len = msg.definitions.Length;

            ShowInFindResultWindow(fileModel, msg.referenceSpan, msg.definitions.Select(d => d.Location).ToArray());
        }
Пример #2
0
        internal void GotoRef(SnapshotPoint point)
        {
            CheckDisposed();
            var fileModel = FileModel;
            var client    = fileModel.Server.Client;

            foreach (var projectId in fileModel.GetProjectIds())
            {
                client.Send(new ClientMessage.FindSymbolReferences(projectId, fileModel.Id, point.ToVersionedPos()));
                break;
            }
            var msg  = client.Receive <ServerMessage.FindSymbolReferences>();
            var locs = msg.symbols.SelectMany(s => s.Definitions.Select(d => d.Location).Concat(s.References.SelectMany(
                                                                                                    referenc => referenc.Ranges.Select(range => new Location(referenc.File, range))))).ToArray();

            ShowInFindResultWindow(fileModel, msg.referenceSpan, locs);
        }