Skip to content

Refactor core parts#135

Merged
ony3000 merged 9 commits intomasterfrom
refactor-core
Feb 7, 2026
Merged

Refactor core parts#135
ony3000 merged 9 commits intomasterfrom
refactor-core

Conversation

@ony3000
Copy link
Copy Markdown
Owner

@ony3000 ony3000 commented Feb 7, 2026

  • Added core parts responsible for the AST related logic.
  • Renamed some core parts to better fit their roles.
  • Reduced code duplication by separating similarly written logic across multiple finders into separate functions.

Copy link
Copy Markdown

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 refactors the plugin’s core AST-processing pipeline by moving parsing/processing responsibilities into dedicated core-parts/* modules and consolidating multiple “finder” implementations into shared, parser-specific handlers.

Changes:

  • Moved advancedParse into src/core-parts/parser.ts and parseLineByLineAndReplaceAsync into src/core-parts/processor.ts.
  • Centralized constants/types in src/core-parts/utils.ts and updated imports accordingly.
  • Reworked src/core-parts/finder.ts to use a handler-table approach (parserCaseHandlers) instead of multiple near-duplicate finder functions.

Reviewed changes

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

Show a summary per file
File Description
src/parsers.ts Updated to use new advancedParse and processor entrypoint; removed in-file AST parsing helper.
src/core-parts/utils.ts Reordered exports and now serves as the shared source for constants/types used across core parts.
src/core-parts/processor.ts Hosts the line-by-line replacement/assembly logic and dispatches to new “based on …” finder functions.
src/core-parts/parser.ts Owns advancedParse and Svelte AST refinement behavior.
src/core-parts/finder.ts Major refactor: consolidated logic via per-parser case handlers and new exported finder entrypoints.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/core-parts/finder.ts
@ony3000 ony3000 merged commit 4be7f93 into master Feb 7, 2026
15 checks passed
@ony3000 ony3000 deleted the refactor-core branch February 7, 2026 15:23
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