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

Don't show misc files project in hover info #10503

Merged
merged 1 commit into from
Jun 19, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ internal sealed class MiscFilesHostProject : HostProject
{
public static MiscFilesHostProject Instance { get; } = Create();

public static bool IsMiscellaneousProject(IProjectSnapshot project)
{
return project.Key == Instance.Key;
}

public string DirectoryPath { get; }

private MiscFilesHostProject(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ await _projectManager.UpdateAsync(
if (_projectManager.IsDocumentOpen(textDocumentPath))
{
_logger.LogInformation($"Moving document '{textDocumentPath}' from project '{projectSnapshot.Key}' to misc files because it is open.");
var miscellaneousProject = _projectManager.GetMiscellaneousProject();
if (projectSnapshot != miscellaneousProject)
if (!MiscFilesHostProject.IsMiscellaneousProject(projectSnapshot))
{
var miscellaneousProject = _projectManager.GetMiscellaneousProject();
MoveDocument(updater, textDocumentPath, fromProject: projectSnapshot, toProject: miscellaneousProject);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ internal abstract class TagHelperTooltipFactoryBase(IProjectSnapshotManager proj

foreach (var project in projectSnapshots)
{
if (MiscFilesHostProject.IsMiscellaneousProject(project))
{
continue;
}

var found = false;
var tagHelpers = await project.GetTagHelpersAsync(cancellationToken).ConfigureAwait(false);
foreach (var tagHelper in tagHelpers)
Expand Down