コード例 #1
0
 public BackgroundCompilation(CompilationTaggerProvider provider, ITextBuffer textBuffer)
 {
     this.provider   = provider;
     this.textBuffer = new WeakReference <ITextBuffer>(textBuffer);
     this.cancellationTokenSource       = new CancellationTokenSource();
     this.compilationSnapshot           = MetaDslx.VisualStudio.Classification.CompilationSnapshot.Default;
     this.backgroundCompilationSnapshot = MetaDslx.VisualStudio.Classification.CompilationSnapshot.Default;
 }
コード例 #2
0
        private void BackgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            CompilationSnapshot oldCompilation = this.backgroundCompilationSnapshot;

            if (this.compilationSnapshot != oldCompilation)
            {
                Interlocked.Exchange(ref this.compilationSnapshot, this.backgroundCompilationSnapshot);
                this.CompilationChanged?.Invoke(this, new CompilationChangedEventArgs(oldCompilation, this.compilationSnapshot));
            }
        }
コード例 #3
0
 public CompilationErrorsSnapshot Update(string filePath, CompilationSnapshot compilationSnapshot)
 {
     Debug.Assert(this.NextSnapshot == null);
     Interlocked.CompareExchange(ref this.NextSnapshot, new CompilationErrorsSnapshot(filePath, this.versionNumber + 1, compilationSnapshot), null);
     return(this.NextSnapshot);
 }
コード例 #4
0
 internal CompilationErrorsSnapshot(string filePath, int versionNumber, CompilationSnapshot compilationSnapshot)
 {
     this.filePath            = filePath;
     this.versionNumber       = versionNumber;
     this.compilationSnapshot = compilationSnapshot;
 }
コード例 #5
0
 public CompilationChangedEventArgs(CompilationSnapshot oldCompilation, CompilationSnapshot newCompilation)
 {
     this.OldCompilation = oldCompilation;
     this.NewCompilation = newCompilation;
 }
コード例 #6
0
 internal void UpdateErrors(string filePath, CompilationSnapshot compilationSnapshot)
 {
     Interlocked.Exchange(ref this.currentSnapshot, this.currentSnapshot.Update(filePath, compilationSnapshot));
 }