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 some shims that were being used by Live Unit Testing #43411

Merged
merged 1 commit into from
Apr 17, 2020
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 @@ -22,7 +22,7 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem
{
using Workspace = Microsoft.CodeAnalysis.Workspace;

[Obsolete("This is a compatibility shim for TypeScript and Live Unit Testing; please do not use it.")]
[Obsolete("This is a compatibility shim for TypeScript; please do not use it.")]
internal abstract partial class AbstractProject : ForegroundThreadAffinitizedObject, IVisualStudioHostProject
{
internal const string ProjectGuidPropertyName = "ProjectGuid";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.Host;
using Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.Extensions;

namespace Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,19 +291,6 @@ internal VisualStudioProjectTracker ProjectTracker
return null;
}

[Obsolete("This is a compatibility shim for Live Unit Testing; please do not use it.")]
internal AbstractProject? GetHostProject(ProjectId projectId)
{
var project = CurrentSolution.GetProject(projectId);

if (project == null)
{
return null;
}

return new StubProject(ProjectTracker, project, GetHierarchy(projectId), project.OutputFilePath);
}

// TODO: consider whether this should be going to the project system directly to get this path. This is only called on interactions from the
// Solution Explorer in the SolutionExplorerShim, where if we just could more directly get to the rule set file it'd simplify this.
internal override string? TryGetRuleSetPathForProject(ProjectId projectId)
Expand All @@ -321,21 +308,6 @@ internal VisualStudioProjectTracker ProjectTracker
}
}

[Obsolete("This is a compatibility shim for Live Unit Testing; please do not use it.")]
private sealed class StubProject : AbstractProject
{
private readonly string? _outputPath;

public StubProject(VisualStudioProjectTracker projectTracker, CodeAnalysis.Project project, IVsHierarchy? hierarchy, string? outputPath)
: base(projectTracker, null, project.Name + "_Stub", null, hierarchy, project.Language, Guid.Empty, null, null, null, null)
{
_outputPath = outputPath;
}

protected override string? GetOutputFilePath()
=> _outputPath;
}

[Obsolete("This is a compatibility shim for TypeScript; please do not use it.")]
internal IVisualStudioHostDocument? GetHostDocument(DocumentId documentId)
{
Expand Down