Skip to content

refactor: remove hoisting and add JSDoc to matchTag in Emmet - #336949

Open
Vedansh Shetti (vedanshshetti) wants to merge 1 commit into
microsoft:mainfrom
vedanshshetti:refctor-improve-matchTagFile
Open

Vedansh Shetti (vedanshshetti) wants to merge 1 commit into
microsoft:mainfrom
vedanshshetti:refctor-improve-matchTagFile

Conversation

@vedanshshetti

Copy link
Copy Markdown

Description:

This PR refactors extensions/emmet/src/matchTag.ts to improve code readability and logical flow.

Changes:

  • Moved the helper function getUpdatedSelections above the main exported function matchTag. This follows a "define-before-use" pattern, allowing readers to understand the implementation details before seeing the high-level logic.
  • Added JSDoc comments to matchTag to clearly describe its purpose and behavior.
  • Added explicit : void return type to matchTag for better TypeScript clarity.

Motivation:

The previous structure required jumping to the bottom of the file to understand the core logic used in matchTag. By reordering the functions and adding documentation, the file becomes easier to read and maintain for new contributors without changing any runtime behavior.

Side-Note, if you think the commit message looks off or something, that's because I used GH Copilot to write the commit msg. But I wrote the code myself.

Copilot AI balanced review requested due to automatic review settings September 20, 2026 20:33

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

3 participants