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

feat: parsing & hir of impl blocks #551

Merged
merged 4 commits into from
Jan 7, 2024

Conversation

baszalmstra
Copy link
Collaborator

This is the first PR to support impl blocks for structs. Features included in this PR are:

  • Parsing of impl blocks. (ast::Impl and friends)
  • Support impl blocks in ItemTree.
  • Resolve self type of impl
  • Collect all impls from a package, or for a specific (struct) type.
  • Several diagnostics related to impl blocks. (See tests in method_resolution.rs)
  • Impl code model to interact with impl blocks

Notable features that are still missing and will be addressed in followup PRs:

  • self type.
  • Code generation.
  • Only functions are support in impls. (type alias is missing)
  • Language server support
  • Docs

Copy link

codecov bot commented Dec 30, 2023

Codecov Report

Attention: 138 lines in your changes are missing coverage. Please review.

Comparison is base (99e5217) 87.37% compared to head (9290fd5) 87.42%.
Report is 3 commits behind head on main.

Files Patch % Lines
crates/mun_hir/src/code_model/impl.rs 53.42% 34 Missing ⚠️
crates/mun_hir/src/method_resolution.rs 87.50% 27 Missing ⚠️
crates/mun_syntax/src/ast/extensions.rs 0.00% 18 Missing ⚠️
crates/mun_hir/src/diagnostics.rs 33.33% 14 Missing ⚠️
crates/mun_syntax/src/ast/generated.rs 76.66% 14 Missing ⚠️
crates/mun_hir/src/has_module.rs 64.00% 9 Missing ⚠️
crates/mun_hir/src/ids.rs 60.00% 4 Missing ⚠️
crates/mun_syntax/src/parsing/grammar/traits.rs 82.60% 4 Missing ⚠️
crates/mun_hir/src/utils.rs 57.14% 3 Missing ⚠️
..._diagnostics/src/hir/duplicate_definition_error.rs 88.23% 2 Missing ⚠️
... and 8 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #551      +/-   ##
==========================================
+ Coverage   87.37%   87.42%   +0.05%     
==========================================
  Files         271      276       +5     
  Lines       31309    31970     +661     
==========================================
+ Hits        27357    27951     +594     
- Misses       3952     4019      +67     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

crates/mun_hir/src/diagnostics.rs Outdated Show resolved Hide resolved
crates/mun_hir/src/ids.rs Show resolved Hide resolved
crates/mun_hir/src/item_tree/lower.rs Outdated Show resolved Hide resolved
crates/mun_hir/src/method_resolution.rs Outdated Show resolved Hide resolved
crates/mun_syntax/src/ast/extensions.rs Show resolved Hide resolved
crates/mun_syntax/src/ast/generated.rs Show resolved Hide resolved
@baszalmstra baszalmstra marked this pull request as ready for review January 7, 2024 17:09
@Wodann Wodann added the type: feat New feature or request label Jan 7, 2024
@Wodann Wodann added this to the Mun v0.6.0 milestone Jan 7, 2024
@Wodann Wodann merged commit 7a99ba6 into mun-lang:main Jan 7, 2024
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feat New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants