Merged
Conversation
Owner
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.
There was a problem hiding this comment.
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
advancedParseintosrc/core-parts/parser.tsandparseLineByLineAndReplaceAsyncintosrc/core-parts/processor.ts. - Centralized constants/types in
src/core-parts/utils.tsand updated imports accordingly. - Reworked
src/core-parts/finder.tsto 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.