Ejemplo n.º 1
0
        public async ValueTask StartTrackingAsync(
            Solution solution,
            CancellationToken cancellationToken
            )
        {
            var newSession = new TrackingSession(_workspace, _spanProvider);

            if (Interlocked.CompareExchange(ref _session, newSession, null) != null)
            {
                newSession.EndTracking();
                Contract.Fail("Can only track active statements for a single edit session.");
            }

            await newSession
            .TrackActiveSpansAsync(solution, cancellationToken)
            .ConfigureAwait(false);

            TrackingChanged?.Invoke();
        }