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 Solution.WithProjectInfo API #74289

Merged
merged 3 commits into from
Aug 2, 2024
Merged

Add Solution.WithProjectInfo API #74289

merged 3 commits into from
Aug 2, 2024

Conversation

tmat
Copy link
Member

@tmat tmat commented Jul 8, 2024

Returns a new Solution snapshot with the target project updated to values specified in ProjectInfo.

Makes it possible for dotnet-watch to incrementally update Solution based on information loaded from MSBuild.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 8, 2024
@tmat tmat force-pushed the WithProjectInfo branch 3 times, most recently from 315f416 to a79cff4 Compare July 8, 2024 22:56
@tmat tmat force-pushed the WithProjectInfo branch 3 times, most recently from b052d1f to da393a3 Compare July 22, 2024 16:48
@tmat tmat force-pushed the WithProjectInfo branch from da393a3 to 6464cd9 Compare July 25, 2024 19:39
@tmat tmat force-pushed the WithProjectInfo branch from 6464cd9 to c5bd1b1 Compare August 2, 2024 01:48
@tmat tmat force-pushed the WithProjectInfo branch from c5bd1b1 to e5c3c59 Compare August 2, 2024 18:56
@tmat tmat changed the title With project info Add Solution.WithProjectInfo API Aug 2, 2024
@tmat tmat marked this pull request as ready for review August 2, 2024 18:59
@tmat tmat requested a review from a team as a code owner August 2, 2024 18:59
@tmat
Copy link
Member Author

tmat commented Aug 2, 2024

@dotnet/roslyn-ide @ToddGrun @CyrusNajmabadi @jasonmalinowski ptal

@CyrusNajmabadi
Copy link
Member

overall this change seems ok. i def have some questions, and some small suggestions.

I'm not a fan of seeing null becoming first class in these codepaths :) but i can be convinced it's ok if we talk about it.

@CyrusNajmabadi
Copy link
Member

high level preference, if we can disallow null (or moving from non-null to null), that would be my STRONG preference.

@tmat
Copy link
Member Author

tmat commented Aug 2, 2024

high level preference, if we can disallow null (or moving from non-null to null), that would be my STRONG preference.

The issue is that our APIs are inconsistent. We allow nulls in some public APIs such as ProjectInfo and disallow in others (WithCompilationOptions, WithParseOptions). I assume this is to support non-C#/VB projects.

@CyrusNajmabadi
Copy link
Member

The issue is that our APIs are inconsistent. We allow nulls in some public APIs such as ProjectInfo and disallow in others (WithCompilationOptions, WithParseOptions). I assume this is to support non-C#/VB projects.

My feeling is that this should be like 'language' (which cannot be changed). If you hve a language with options, then you have options, and they should not be null. If you have a language without options, then you don't have options, and it should only be null. The change between (especially non-null to null) feels broken and confusing to me.

{
if (options == CompilationOptions)
{
return this;
}

if (options == null)
{
throw new NotSupportedException(WorkspacesResources.Removing_compilation_options_is_not_supported);
Copy link
Member

Choose a reason for hiding this comment

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

tnx.

@tmat tmat enabled auto-merge (squash) August 2, 2024 20:55
@tmat tmat merged commit d53f0be into dotnet:main Aug 2, 2024
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Aug 2, 2024
@tmat tmat deleted the WithProjectInfo branch August 3, 2024 00:10
@chsienki chsienki mentioned this pull request Aug 5, 2024
@dibarbet dibarbet modified the milestones: Next, 17.12 P2 Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants