Ejemplo n.º 1
0
        public override Task DocumentCloseAsync(Document document, CancellationToken cancellationToken)
        {
            using (Logger.LogBlock(FunctionId.Diagnostics_DocumentClose, GetResetLogMessage, document, cancellationToken))
            {
                // we don't need the info for closed file
                _memberRangeMap.Remove(document.Id);

                return(ClearOnlyDocumentStates(document, raiseEvent: true, cancellationToken: cancellationToken));
            }
        }
Ejemplo n.º 2
0
        public override Task DocumentResetAsync(Document document, CancellationToken cancellationToken)
        {
            using (Logger.LogBlock(FunctionId.Diagnostics_DocumentReset, GetResetLogMessage, document, cancellationToken))
            {
                // we don't need the info for closed file
                _memberRangeMap.Remove(document.Id);

                // we remove whatever information we used to have on document open/close and re-calcuate diagnostics
                // we had to do this since some diagnostic provider change its behavior based on whether the document is opend or not.
                // so we can't use cached information.
                return(RemoveAllCacheDataAsync(document, cancellationToken));
            }
        }
Ejemplo n.º 3
0
        public override Task DocumentResetAsync(Document document, CancellationToken cancellationToken)
        {
            using (Logger.LogBlock(FunctionId.Diagnostics_DocumentReset, GetResetLogMessage, document, cancellationToken))
            {
                // we don't need the info for closed file
                _memberRangeMap.Remove(document.Id);

                // we remove whatever information we used to have on document open/close and re-calculate diagnostics
                // we had to do this since some diagnostic analyzer changes its behavior based on whether the document is opened or not.
                // so we can't use cached information.
                ClearDocumentStates(document, _stateManger.GetStateSets(document.Project), raiseEvent: false, cancellationToken: cancellationToken);
                return(SpecializedTasks.EmptyTask);
            }
        }