Skip to content

Conversation

@Andarist
Copy link
Contributor

@Andarist Andarist commented Jun 4, 2025

Copilot AI review requested due to automatic review settings June 4, 2025 21:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ports the fix for Automatic Semicolon Insertion after get/set keywords from the upstream TypeScript PR.

  • Updates test baselines (JS and error files) in the conformance submodule to validate the new syntax for get/set keywords.
  • Adjusts parser logic in internal/parser/parser.go to handle get/set keywords separately from the static modifier.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
testdata/baselines/reference/submodule/conformance/canFollowGetSetKeyword.js.diff Updates test baselines for class and object declarations using get/set keywords.
testdata/baselines/reference/submodule/conformance/canFollowGetSetKeyword.js Reflects valid usage of get/set in class and object definitions.
testdata/baselines/reference/submodule/conformance/canFollowGetSetKeyword.errors.txt.diff Removes previously expected errors due to shorthand property issues with get/set.
testdata/baselines/reference/submodule/conformance/canFollowGetSetKeyword.errors.txt Updates error baseline matching the new parser behavior for get/set usage.
internal/parser/parser.go Refactors token handling to route get/set keywords through a dedicated check.
Comments suppressed due to low confidence (1)

internal/parser/parser.go:3969

  • [nitpick] Consider adding documentation for this function to clarify its purpose and delineate how its allowed tokens differ from those checked in canFollowModifier().
func (p *Parser) canFollowGetOrSetKeyword() bool {

case ast.KindStaticKeyword, ast.KindGetKeyword, ast.KindSetKeyword:
case ast.KindStaticKeyword:
p.nextToken()
return p.canFollowModifier()
Copy link

Copilot AI Jun 4, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider adding a comment explaining why get and set keywords are handled separately from static, to improve clarity for future maintainers.

Suggested change
return p.canFollowModifier()
return p.canFollowModifier()
// `get` and `set` are contextual keywords that require specific validation logic
// to determine their role in the syntax (e.g., as accessors or other constructs).

Copilot uses AI. Check for mistakes.
@jakebailey jakebailey added this pull request to the merge queue Jun 4, 2025
Merged via the queue into microsoft:main with commit f2e0063 Jun 4, 2025
23 checks passed
@jakebailey jakebailey mentioned this pull request Jul 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants