Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove BackgroundParser and BackgroundCompiler #58453

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 3 additions & 27 deletions src/EditorFeatures/TestUtilities/Workspaces/TestWorkspace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ public partial class TestWorkspace : Workspace

internal override bool IgnoreUnchangeableDocumentsWhenApplyingChanges { get; }

private readonly BackgroundCompiler _backgroundCompiler;
private readonly BackgroundParser _backgroundParser;
private bool _partialSemanticsEnabled;
private readonly IMetadataAsSourceFileService _metadataAsSourceFileService;

private readonly Dictionary<string, ITextBuffer2> _createdTextBuffers = new();
Expand Down Expand Up @@ -100,9 +99,7 @@ public TestWorkspace(
};
}

_backgroundCompiler = new BackgroundCompiler(this);
_backgroundParser = new BackgroundParser(this);
_backgroundParser.Start();
_partialSemanticsEnabled = true;

_metadataAsSourceFileService = ExportProvider.GetExportedValues<IMetadataAsSourceFileService>().FirstOrDefault();

Expand All @@ -117,28 +114,12 @@ private static HostServices GetHostServices(ExportProvider? exportProvider = nul

protected internal override bool PartialSemanticsEnabled
{
get { return _backgroundCompiler != null; }
get { return _partialSemanticsEnabled; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is always true?

}

public TestHostDocument DocumentWithCursor
=> Documents.Single(d => d.CursorPosition.HasValue && !d.IsLinkFile);

protected override void OnDocumentTextChanged(Document document)
{
if (_backgroundParser != null)
{
_backgroundParser.Parse(document);
}
}

protected override void OnDocumentClosing(DocumentId documentId)
{
if (_backgroundParser != null)
{
_backgroundParser.CancelParse(documentId);
}
}

public new void RegisterText(SourceTextContainer text)
=> base.RegisterText(text);

Expand Down Expand Up @@ -168,11 +149,6 @@ protected override void Dispose(bool finalize)
document.CloseTextView();
}

if (_backgroundParser != null)
{
_backgroundParser.CancelAllParses();
}

base.Dispose(finalize);
}

Expand Down
196 changes: 0 additions & 196 deletions src/Features/Core/Portable/Workspace/BackgroundCompiler.cs

This file was deleted.

Loading