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

Improve parsing recovery with 'file' keyword #76185

Merged
merged 5 commits into from
Dec 5, 2024

Conversation

CyrusNajmabadi
Copy link
Member

Fixes #75992

@CyrusNajmabadi CyrusNajmabadi requested review from a team as code owners November 30, 2024 21:23
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Nov 30, 2024
@CyrusNajmabadi
Copy link
Member Author

@dotnet/roslyn-compiler @RikkiGibson ptal.

@jaredpar jaredpar added Feature - File-Local Types File-local types (file types) and removed untriaged Issues and PRs which have not yet been triaged by a lead VSCode labels Dec 2, 2024
@CyrusNajmabadi
Copy link
Member Author

@dotnet/roslyn-compiler @RikkiGibson ptal. Thanks!

while (true)
{
if (this.CurrentToken.Kind == SyntaxKind.OpenBraceToken ||
((_termState & TerminatorState.IsEndOfRecordOrClassOrStructOrInterfaceSignature) != 0 && this.CurrentToken.Kind == SyntaxKind.SemicolonToken) ||
Copy link
Member Author

Choose a reason for hiding this comment

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

_termState check was unnecessary. Assert and comment added at start of method to explain why.

{
UsingTree("""
class C : B
file class D
Copy link
Contributor

Choose a reason for hiding this comment

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

I imagine a similar, more contrived case may also be positively impacted

class Outer
{
    class C : B

    required int Prop { get; set; }
}

but, don't find it interesting enough to ask you to come back and add the test.

@CyrusNajmabadi
Copy link
Member Author

@dotnet/roslyn-compiler for a second pair of eyes on this simple pr :) Thanks!

@CyrusNajmabadi CyrusNajmabadi merged commit 517ce1a into dotnet:main Dec 5, 2024
28 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the fileModifierParsing branch December 5, 2024 20:17
@CyrusNajmabadi
Copy link
Member Author

Thanks!

@dibarbet dibarbet added this to the 17.13 P3 milestone Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants