refactor: Use metamodel and remove AST based traversal - #154
Conversation
Signed-off-by: Ashar <ashar786khan@gmail.com>
Signed-off-by: Ashar <ashar786khan@gmail.com>
There was a problem hiding this comment.
@coder3101 Hello, I'd like to explain, why it wasn't mod.rs in #145
https://doc.rust-lang.org/reference/items/modules.html#module-source-filenames
Prior to rustc 1.30, using mod.rs files was the way to load a module with nested children. It is encouraged to use the new naming convention as it is more consistent, and avoids having many files named mod.rs within a project.
I decided not to touch all the modules and focus on the Phase 1.
If you are aligned with the modern approach, we can plan refactoring to remove mod.rs files.
There was a problem hiding this comment.
I would actually prefer to keep using mod.rs. With this, all the files of a module are in a single directory which I prefer over the new convention. We also don't have any nested modules.
There was a problem hiding this comment.
@coder3101 OK, sounds good! I'll stick to the mod.rs style for now to keep it consistent.
Just to clarify my broader point: the goal isn't to dump 20 entry-point files into the src/ root. We can actually do the opposite. By leveraging deeper module nesting—like we already do with src/model/extractor/handlers—we can group related submodules together.
This allows us to minimize the number of entry points in the src/ root to just a few files (or even a single src/server.rs or src/whatever.rs), while the internal submodules can use the modern style cleanly inside their respective directories. This gives us the best of both worlds: a clean root and no endless mod.rs files in the IDE.
Something to consider if we decide to refactor the architecture later!
There was a problem hiding this comment.
Yup that is fine by me. You can open an proposal issue for new structure and we can discuss more on that.
Includes Phase 3 of #130
It also brings in a lot of refactoring and removal of old AST based approach.