Skip to content

Conversation

@CyrusNajmabadi
Copy link
Member

Fixes #72077

var state = _termState;
_termState |= TerminatorState.IsPossibleStatementStartOrStop;
var topLevelStatement = ParseLocalDeclarationStatement(attributes);
_termState = state;
Copy link
Member Author

Choose a reason for hiding this comment

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

note: this also follows the logic in tryParseStatement below. This was just missed when the global code parser decides to specifically only parse out a localdecl statement, not any arbitrary statement.

void C() { }
}
}
""";
Copy link
Member Author

Choose a reason for hiding this comment

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

this didn't change at all. just adding an explicit test showing the behavior when we are not at the top level.

}
N(SyntaxKind.GlobalStatement);
{
N(SyntaxKind.LocalFunctionStatement);
Copy link
Member Author

Choose a reason for hiding this comment

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

this changed. we would previously not get this, and instead end up with most of what followed becoming skipped tokens on the 'C'.

@CyrusNajmabadi CyrusNajmabadi marked this pull request as draft December 11, 2025 16:31
@CyrusNajmabadi
Copy link
Member Author

Moving to draft until #81636 and #81655 go in. They end up making a bunch of scenarios here a lot nicer, and reduce the amount of test churn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Intellisense in: when calling method just above method declaration

1 participant