private static HashSet <LineSpan> LinkedLinesInternal(LineSpan line, CancellationToken cancel) { #if PERFORMANCE object cookie = null; try { PerformanceLogger.Start(ref cookie); return(LinkedLinesInternal_Performance(line, cancel)); } catch (OperationCanceledException) { PerformanceLogger.Mark("Cancel"); throw; } finally { PerformanceLogger.End(cookie); } }
private List <LineSpanChunk> GetLineSpans(IList <LineInfo[]> chunkInfo, CancellationToken cancel) { #if PERFORMANCE object cookie = null; try { PerformanceLogger.Start(ref cookie); return(GetLineSpans_Performance(chunkInfo, cancel)); } catch (OperationCanceledException) { PerformanceLogger.Mark("Cancel"); throw; } finally { PerformanceLogger.End(cookie); } }
private void FindLongestLine( ITextSnapshot snapshot, CancellationToken cancel ) { #if PERFORMANCE object cookie = null; try { PerformanceLogger.Start(ref cookie); FindLongestLine_Performance(snapshot, cancel); } catch (OperationCanceledException) { PerformanceLogger.Mark("Cancel"); throw; } finally { PerformanceLogger.End(cookie); } }
private void SetLineInfo( LineInfo[] lineInfo, ITextSnapshot snapshot, int firstLine, int lastLine, CancellationToken cancel ) { #if PERFORMANCE object cookie = null; try { PerformanceLogger.Start(ref cookie); SetLineInfo_Performance(lineInfo, snapshot, firstLine, lastLine, cancel); } catch (OperationCanceledException) { PerformanceLogger.Mark("Cancel"); throw; } finally { PerformanceLogger.End(cookie); } }
void UpdateAdornmentsWorker() { //var analysisLines = Analysis.Lines; //if (Analysis.Snapshot != View.TextSnapshot) { // var task = Analysis.Update(); // if (task != null) { // UpdateAdornments(task); // } // return; //} else if (analysisLines == null) { // UpdateAdornments(Analysis.Reset()); // return; //} if (!GlobalVisible) { Canvas.Visibility = Visibility.Collapsed; return; } Canvas.Visibility = Visibility.Visible; var snapshot = View.TextSnapshot; var viewModel = View.TextViewModel; if (snapshot == null || viewModel == null) { return; } var firstVisibleLine = View.TextViewLines.FirstOrDefault(line => line.IsFirstTextViewLineForSnapshotLine); if (firstVisibleLine == null) { return; } var lastVisibleLine = View.TextViewLines.LastOrDefault(line => line.IsLastTextViewLineForSnapshotLine); if (lastVisibleLine == null) { return; } var analysisLines = Analysis.GetLines( firstVisibleLine.Start.GetContainingLine().LineNumber, lastVisibleLine.Start.GetContainingLine().LineNumber ); if (!analysisLines.Any()) { return; } #if PERFORMANCE object cookie = null; try { PerformanceLogger.Start(ref cookie); UpdateAdornments_Performance( snapshot, viewModel, firstVisibleLine, analysisLines ); } catch (OperationCanceledException) { PerformanceLogger.Mark("Cancel"); throw; } finally { PerformanceLogger.End(cookie); } }