Skip to content

Make solution crawler and diagnostics options global#59800

Merged
tmat merged 5 commits intodotnet:mainfrom
tmat:SolutionCrawlerOptions
Mar 11, 2022
Merged

Make solution crawler and diagnostics options global#59800
tmat merged 5 commits intodotnet:mainfrom
tmat:SolutionCrawlerOptions

Conversation

@tmat
Copy link
Copy Markdown
Member

@tmat tmat commented Feb 27, 2022

@ghost ghost added the Area-IDE label Feb 27, 2022
@tmat tmat force-pushed the SolutionCrawlerOptions branch from ab78d82 to 986946e Compare February 27, 2022 22:43
@tmat tmat force-pushed the SolutionCrawlerOptions branch from 986946e to 54cbf45 Compare March 8, 2022 20:41
@tmat tmat marked this pull request as ready for review March 9, 2022 03:14
@tmat tmat requested review from a team as code owners March 9, 2022 03:14
@tmat tmat changed the title Solution crawler options Make solution crawler and diagnostics options global Mar 9, 2022
@tmat tmat force-pushed the SolutionCrawlerOptions branch from 654c8e6 to d113a73 Compare March 9, 2022 03:16
@tmat
Copy link
Copy Markdown
Member Author

tmat commented Mar 9, 2022

@CyrusNajmabadi PTAL

@tmat tmat force-pushed the SolutionCrawlerOptions branch from d113a73 to eda115f Compare March 9, 2022 20:23
TokenList);

public static readonly Option2<string> TokenList = new(nameof(TodoCommentOptions), nameof(TokenList), defaultValue: "");
public static readonly TodoCommentOptions Default = new();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

whihc constructor does this call? :'( this part of the language confuses me.

Copy link
Copy Markdown
Member Author

@tmat tmat Mar 9, 2022

Choose a reason for hiding this comment

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

Yes, we did not end up in a good spot here with structs. Not sure if this can be fixed, probably not. This will call the explicitly defined parameterless ctor. The one with optional parameters is different one. That's actually why I'm defining the parameterless one so that one does not end up in a trap of calling new T() and ending up with default(T) instead of the default values.

Also, something like this would be useful:

readonly record struct R(optional T X = <expr>); // T must be non-nullable type

which would translate to:

readonly struct R
{
  public readonly T X;
  R(T? X = default) { this.X = X ?? <expr>; }
}

where <expr> is an arbitrary expression, not limited to constants.

@tmat tmat enabled auto-merge (squash) March 9, 2022 22:42
@tmat
Copy link
Copy Markdown
Member Author

tmat commented Mar 10, 2022

/azp run roslyn-integration-CI

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@tmat tmat force-pushed the SolutionCrawlerOptions branch from 7075b6d to 3354e5c Compare March 10, 2022 21:42
@tmat tmat merged commit da356ee into dotnet:main Mar 11, 2022
@ghost ghost added this to the Next milestone Mar 11, 2022
@tmat tmat deleted the SolutionCrawlerOptions branch March 11, 2022 19:34
@allisonchou allisonchou modified the milestones: Next, 17.2.P3 Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants