Skip to content

Follow syntaxfacts pattern#56351

Merged
CyrusNajmabadi merged 24 commits intodotnet:mainfrom
CyrusNajmabadi:syntaxFacts
Sep 15, 2021
Merged

Follow syntaxfacts pattern#56351
CyrusNajmabadi merged 24 commits intodotnet:mainfrom
CyrusNajmabadi:syntaxFacts

Conversation

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

@CyrusNajmabadi CyrusNajmabadi commented Sep 13, 2021

@ghost ghost added the Area-IDE label Sep 13, 2021
@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review September 13, 2021 22:46
@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner September 13, 2021 22:46
Copy link
Copy Markdown
Contributor

@ryzngard ryzngard left a comment

Choose a reason for hiding this comment

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

Changes overall look good. Comments on spec written in ISyntaxFacts. I think this should go through a quick review for the whole team to make sure we agree on all of these.

/// <item>
/// Functions which are effectively specific to a single feature are are just trying to find a place to place complex
/// feature logic in a place such that it can run over VB or C#. For example, a function to determine if a position
/// is on the 'header' of a node. a 'header' is a not a well defined syntax concept that can be trivially asked of
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.

Should we note that these could go into IRefactoringHelpersService if we want common definitions for abstract concepts like this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i actually am pretty vehemently agqainst the name 'refactoring helpers' as that itself is just vague and leads to kitchen-sink bucketing of things. The current IRefactoringHelpersService should really have a name like IDetermineSelectedNodeService to keep it very well scoped exactly to the concept it can provide. For example, IRefactoringHelpersService shouldn't have things related to formatting/cleanup/code-modification/etc. where 'Refactoring Helpers' might imply that it does.

/// some other feature specific service.
/// </item>
/// <item>
/// Functions that a single item when one language may allow for multiple. For example 'GetIdentifierOfVariableDeclarator'.
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.

Should we specify for these cases that allowing multiple returns is okay? In the example VB has multiple and C# has one. It seems likely if the case is that multiple can ever be returned they should be handled, but 1 and 0 items would also need to be handled.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yup. That seems reasonable.

/// </list>
/// </summary>
/// <remarks>
/// Many helpers in this type currently violate the above 'dos' and 'do nots'. They should be removed and either
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.

What's the plan for this? Did you audit functions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What's the plan for this?

I have no plan currently. Perhaps over time i (and others) can address deviations.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess unless we're going to have a plan to address this...I'm not sure what the point is in setting guidance we don't meet and don't ever plan to meet.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd make an alternate suggestion (and mentioned this to Cyrus privately): let's at least go through the current methods and stick TODO comments for which ones we think are violating but aren't immediately easy to fix in this PR. The challenge with this comment is if I'm somebody new to the codebase, and I read this, but I also see a bunch of violations, I don't know which is wrong. I can see something is wrong, but I don't know what.

…ices/SyntaxFacts/ISyntaxFacts.cs

Co-authored-by: Sam Harwell <sam@tunnelvisionlabs.com>
@CyrusNajmabadi CyrusNajmabadi merged commit 3f2908b into dotnet:main Sep 15, 2021
@ghost ghost added this to the Next milestone Sep 15, 2021
@CyrusNajmabadi CyrusNajmabadi deleted the syntaxFacts branch September 16, 2021 16:36
@Cosifne Cosifne modified the milestones: Next, 17.0.P5 Sep 27, 2021
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.

5 participants