Exemple #1
0
        internal EditSession(
            Solution baseSolution,
            DebuggingSession debuggingSession,
            IActiveStatementProvider activeStatementProvider,
            ImmutableDictionary <ProjectId, ProjectReadOnlyReason> projects,
            ImmutableDictionary <ActiveMethodId, ImmutableArray <NonRemappableRegion> > nonRemappableRegions,
            bool stoppedAtException)
        {
            Debug.Assert(baseSolution != null);
            Debug.Assert(debuggingSession != null);
            Debug.Assert(activeStatementProvider != null);
            Debug.Assert(nonRemappableRegions != null);

            _baseSolution            = baseSolution;
            _debuggingSession        = debuggingSession;
            _activeStatementProvider = activeStatementProvider;
            _stoppedAtException      = stoppedAtException;
            _projects     = projects;
            _cancellation = new CancellationTokenSource();

            // TODO: small dict, pool?
            _analyses = new Dictionary <DocumentId, Analysis>();

            // TODO: small dict, pool?
            _documentsWithReportedRudeEdits = new HashSet <DocumentId>();

            _nonRemappableRegions = nonRemappableRegions;

            BaseActiveStatements       = new AsyncLazy <ActiveStatementsMap>(GetBaseActiveStatementsAsync, cacheResult: true);
            BaseActiveExceptionRegions = new AsyncLazy <ImmutableArray <ActiveStatementExceptionRegions> >(GetBaseActiveExceptionRegionsAsync, cacheResult: true);
        }
        public void ClearDiagnostics(DebuggingSession session, Workspace workspace, object kind, ProjectId projectId, ImmutableArray<DocumentId> documentIds)
        {
            if (documentIds.IsDefault)
            {
                return;
            }

            foreach (var documentId in documentIds)
            {
                ClearDiagnostics(session, workspace, kind, projectId, documentId);
            }
        }
        public ImmutableArray<DocumentId> ReportDiagnostics(DebuggingSession session, object errorId, ProjectId projectId, Solution solution, IEnumerable<Diagnostic> diagnostics)
        {
            var argsByDocument = ImmutableArray.CreateRange(
                from diagnostic in diagnostics
                let document = solution.GetDocument(diagnostic.Location.SourceTree)
                where document != null
                let item = MakeDiagnosticData(projectId, document, solution, diagnostic)
                group item by document.Id into itemsByDocumentId
                select MakeArgs(session, errorId, solution.Workspace, solution, projectId, itemsByDocumentId.Key, ImmutableArray.CreateRange(itemsByDocumentId)));

            foreach (var args in argsByDocument)
            {
                RaiseDiagnosticsUpdated(args);
            }

            return argsByDocument.SelectAsArray(args => args.DocumentId);
        }
Exemple #4
0
        internal EditSession(
            Solution baseSolution,
            IReadOnlyDictionary <DocumentId, ImmutableArray <ActiveStatementSpan> > baseActiveStatements,
            DebuggingSession debuggingSession,
            ImmutableDictionary <ProjectId, ProjectReadOnlyReason> projects,
            bool stoppedAtException)
        {
            Debug.Assert(baseSolution != null);
            Debug.Assert(debuggingSession != null);

            _baseSolution       = baseSolution;
            _debuggingSession   = debuggingSession;
            _stoppedAtException = stoppedAtException;
            _projects           = projects;
            _cancellation       = new CancellationTokenSource();

            // TODO: small dict, pool?
            _analyses             = new Dictionary <DocumentId, Analysis>();
            _baseActiveStatements = baseActiveStatements;

            // TODO: small dict, pool?
            _documentsWithReportedRudeEdits = new HashSet <DocumentId>();
        }
Exemple #5
0
        internal EditSession(
            Solution baseSolution,
            IReadOnlyDictionary<DocumentId, ImmutableArray<ActiveStatementSpan>> baseActiveStatements,
            DebuggingSession debuggingSession,
            ImmutableDictionary<ProjectId, ProjectReadOnlyReason> projects,
            bool stoppedAtException)
        {
            Debug.Assert(baseSolution != null);
            Debug.Assert(debuggingSession != null);

            _baseSolution = baseSolution;
            _debuggingSession = debuggingSession;
            _stoppedAtException = stoppedAtException;
            _projects = projects;
            _cancellation = new CancellationTokenSource();

            // TODO: small dict, pool?
            _analyses = new Dictionary<DocumentId, Analysis>();
            _baseActiveStatements = baseActiveStatements;

            // TODO: small dict, pool?
            _documentsWithReportedRudeEdits = new HashSet<DocumentId>();
        }
 private DiagnosticsUpdatedArgs MakeArgs(
     DebuggingSession session, object errorId, Workspace workspace, Solution solution, ProjectId projectId, DocumentId documentId, ImmutableArray<DiagnosticData> items)
 {
     return new DiagnosticsUpdatedArgs(
         id: Tuple.Create(session, errorId),
         workspace: workspace,
         solution: solution,
         projectId: projectId,
         documentId: documentId,
         diagnostics: items);
 }
 private DiagnosticsUpdatedArgs MakeArgs(
     DebuggingSession session, Workspace workspace, object errorId, ProjectId projectId, DocumentId documentId, ImmutableArray<DiagnosticData> items)
 {
     return MakeArgs(session, errorId, workspace, solution: null, projectId: projectId, documentId: documentId, items: items);
 }
 public void ClearDiagnostics(DebuggingSession session, Workspace workspace, object errorId, ProjectId projectId, DocumentId documentId)
 {
     RaiseDiagnosticsUpdated(MakeArgs(session, workspace, errorId, projectId, documentId, ImmutableArray.Create<DiagnosticData>()));
 }
Exemple #9
0
 public void EndDebuggingSession()
 {
     Debug.Assert(this.debuggingSession != null && this.editSession == null);
     this.debuggingSession = null;
 }
 public CommittedSolution(DebuggingSession debuggingSession, Solution solution)
 {
     _solution         = solution;
     _debuggingSession = debuggingSession;
     _documentState    = new Dictionary <DocumentId, DocumentState>();
 }
Exemple #11
0
 public void EndDebuggingSession()
 {
     Debug.Assert(_debuggingSession != null && _editSession == null);
     _debuggingSession = null;
 }
 public void EndDebuggingSession()
 {
     Debug.Assert(_debuggingSession != null && _editSession == null);
     _debuggingSession = null;
 }