Skip to content

Commit

Permalink
Don't show misc files project in hover info (#10503)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwengier authored Jun 19, 2024
2 parents ff239f4 + b2eb816 commit 6b37ec2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
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

0 comments on commit 6b37ec2

Please sign in to comment.