Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: refactored RawItems into ItemTree #271

Merged
merged 1 commit into from
Sep 23, 2020

Conversation

baszalmstra
Copy link
Collaborator

First refactor to remove RawItems and create better separation of concerns. ItemTree is a derived AST that only contains module items. All interning is now done as ItemTree ids instead of building directly on the AST. Hopefully, this creates a clearer separation between items and the AST.

When adding modules (which Im also working on) having this ItemTree is much clearer than using either RawItems or the code model or a strange combination. Im not sure yet how to handle the TypeRefSourceMap, Im looking into removing that too.

@codecov
Copy link

codecov bot commented Sep 20, 2020

Codecov Report

Merging #271 into master will decrease coverage by 0.00%.
The diff coverage is 91.91%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #271      +/-   ##
==========================================
- Coverage   79.05%   79.05%   -0.01%     
==========================================
  Files         214      217       +3     
  Lines       12808    12941     +133     
==========================================
+ Hits        10125    10230     +105     
- Misses       2683     2711      +28     
Impacted Files Coverage Δ
crates/mun_hir/src/source_id.rs 64.28% <ø> (-21.43%) ⬇️
crates/mun_hir/src/item_tree.rs 74.50% <74.50%> (ø)
crates/mun_hir/src/code_model/src.rs 42.30% <78.57%> (+21.25%) ⬆️
crates/mun_hir/src/code_model.rs 81.41% <89.47%> (+1.68%) ⬆️
crates/mun_hir/src/adt.rs 94.73% <100.00%> (+4.73%) ⬆️
crates/mun_hir/src/db.rs 100.00% <100.00%> (ø)
crates/mun_hir/src/expr/validator/tests.rs 100.00% <100.00%> (ø)
crates/mun_hir/src/ids.rs 100.00% <100.00%> (ø)
crates/mun_hir/src/item_tree/lower.rs 100.00% <100.00%> (ø)
crates/mun_hir/src/item_tree/tests.rs 100.00% <100.00%> (ø)
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c84daf7...d25a997. Read the comment docs.

Copy link
Collaborator

@Wodann Wodann left a comment

Choose a reason for hiding this comment

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

Nice refactor. I don't have anything to improve, except a typo in the comments.

crates/mun_hir/src/item_tree/lower.rs Outdated Show resolved Hide resolved
@baszalmstra baszalmstra merged commit 575a3ba into mun-lang:master Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: refactor Refactor existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants