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: use statements language support #290

Merged
merged 9 commits into from
Feb 28, 2021

Conversation

baszalmstra
Copy link
Collaborator

@baszalmstra baszalmstra commented Dec 29, 2020

Adds the use of use statements in the code.

✔️ Features

  • Parsing of use statements (e.g. use foo::bar::{Bar, Baz})
  • Resolve all use statements in all modules
  • Errors for unresolved use statement
  • Errors for cyclic use statements
  • Wildcard use statements
  • Proper error for importing a duplicate name

❓ Missing features, but planned

I will create issues for these once this is merged.

  • Errors for illegal import statement visibility
  • Errors for leaking non-visibile types

❌ Out of scope

  • Runtime dependencies (so this is actually not actually usable yet)

Closes #249

@baszalmstra baszalmstra self-assigned this Dec 29, 2020
@codecov
Copy link

codecov bot commented Dec 29, 2020

Codecov Report

Merging #290 (0fd6ae6) into master (c0185b7) will decrease coverage by 0.61%.
The diff coverage is 80.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #290      +/-   ##
==========================================
- Coverage   81.41%   80.80%   -0.62%     
==========================================
  Files         239      240       +1     
  Lines       14025    14584     +559     
==========================================
+ Hits        11419    11785     +366     
- Misses       2606     2799     +193     
Impacted Files Coverage Δ
crates/mun_hir/src/item_tree.rs 76.59% <0.00%> (-2.76%) ⬇️
crates/mun_hir/src/item_tree/tests.rs 93.54% <0.00%> (-6.46%) ⬇️
crates/mun_hir/src/module_tree.rs 86.73% <ø> (ø)
crates/mun_syntax/src/lib.rs 63.04% <ø> (ø)
crates/mun_hir/src/item_scope.rs 49.36% <29.62%> (-43.23%) ⬇️
crates/mun_hir/src/visibility.rs 80.64% <50.00%> (-7.36%) ⬇️
crates/mun_hir/src/diagnostics.rs 63.98% <66.66%> (+1.92%) ⬆️
crates/mun_syntax/src/syntax_kind/generated.rs 67.74% <80.00%> (+0.45%) ⬆️
crates/mun_hir/src/package_defs/collector.rs 82.35% <82.12%> (-2.43%) ⬇️
crates/mun_hir/src/item_tree/lower.rs 95.41% <84.61%> (-4.59%) ⬇️
... and 34 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 c0185b7...0fd6ae6. Read the comment docs.

@baszalmstra baszalmstra marked this pull request as ready for review December 31, 2020 11:43
@baszalmstra baszalmstra requested a review from Wodann December 31, 2020 11:43
@baszalmstra baszalmstra added this to the Mun v0.3.0 milestone Dec 31, 2020
@baszalmstra baszalmstra added exp: intermediate Achievable by experienced contributors, or with some guidance pri: intermediate An issue resulting in non-critical functionality loss and no significant effect on usability type: feat New feature or request and removed exp: intermediate Achievable by experienced contributors, or with some guidance labels Dec 31, 2020
@baszalmstra baszalmstra changed the title Feature/use statement feature: use statements language support Jan 4, 2021
@baszalmstra baszalmstra force-pushed the feature/use_statement branch 2 times, most recently from c56c24f to 13bfdbf Compare January 22, 2021 14:14
@baszalmstra baszalmstra force-pushed the feature/use_statement branch from 13bfdbf to 145f95b Compare February 5, 2021 16:09
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.

Nicely done. No comments about the architecture or code; just a couple of requests in terms of spelling, grammar, and documentation.

crates/mun_hir/src/code_model/module.rs Show resolved Hide resolved
crates/mun_hir/src/item_scope.rs Outdated Show resolved Hide resolved
crates/mun_hir/src/item_scope.rs Outdated Show resolved Hide resolved
crates/mun_hir/src/item_scope.rs Outdated Show resolved Hide resolved
crates/mun_hir/src/item_scope.rs Outdated Show resolved Hide resolved
crates/mun_hir/src/path.rs Show resolved Hide resolved
crates/mun_hir/src/path.rs Show resolved Hide resolved
crates/mun_hir/src/path.rs Outdated Show resolved Hide resolved
crates/mun_hir/src/visibility.rs Outdated Show resolved Hide resolved
crates/mun_syntax/src/parsing/grammar/declarations.rs Outdated Show resolved Hide resolved
@baszalmstra baszalmstra force-pushed the feature/use_statement branch from 63c257a to 0fd6ae6 Compare February 26, 2021 15:01
@baszalmstra baszalmstra requested a review from Wodann February 26, 2021 15:02
@baszalmstra baszalmstra merged commit b83586a into mun-lang:master Feb 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pri: intermediate An issue resulting in non-critical functionality loss and no significant effect on usability type: feat New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add language support for use statement
2 participants