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

Add ProjectInfo.WithId #74665

Closed
tmat opened this issue Aug 6, 2024 · 2 comments
Closed

Add ProjectInfo.WithId #74665

tmat opened this issue Aug 6, 2024 · 2 comments
Labels
api-approved API was approved in API review, it can be implemented Area-IDE Concept-API This issue involves adding, removing, clarification, or modification of an API. Feature Request untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@tmat
Copy link
Member

tmat commented Aug 6, 2024

Background and Motivation

Useful for dotnet-watch, where we need to take ProjectInfo returned MSBuildProjectLoader and remap its ID to a project with the same project file path.

Proposed API

namespace Microsoft.CodeAnalysis;

public sealed class ProjectInfo
{
+    public ProjectInfo WithId(ProjectId id);
}

Similar API is already available for DocumentInfo.

Usage Examples

var mappedInfo = projectInfo.WithId(oldProjectId);

Alternative Designs

Risks

@tmat tmat added Concept-API This issue involves adding, removing, clarification, or modification of an API. Feature Request labels Aug 6, 2024
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 6, 2024
@tmat tmat added the api-ready-for-review API is ready for review, it is NOT ready for implementation label Aug 6, 2024
@333fred
Copy link
Member

333fred commented Aug 29, 2024

API Review

  • Should we add Solution.WithId for consistency?
    • No use cases

Approved

@333fred 333fred added api-approved API was approved in API review, it can be implemented and removed api-ready-for-review API is ready for review, it is NOT ready for implementation labels Aug 29, 2024
@tmat
Copy link
Member Author

tmat commented Aug 31, 2024

Implemented by #74664

@tmat tmat closed this as completed Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-approved API was approved in API review, it can be implemented Area-IDE Concept-API This issue involves adding, removing, clarification, or modification of an API. Feature Request untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

2 participants