-
Notifications
You must be signed in to change notification settings - Fork 248
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(LSP): auto-import via visible reexport #7409
Merged
Merged
Conversation
This file contains 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
This is the actual bug in #7378 where an item from a non-dependency is suggested.
jfecher
approved these changes
Feb 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
TomAFrench
added a commit
that referenced
this pull request
Feb 19, 2025
* master: fix(performance): Remove redundant slice access check from brillig (#7434) chore(docs): updating tutorials and other nits to beta.2 (#7405) feat: LSP hover for integer literals (#7368) feat(experimental): Compile match expressions (#7312) feat(acir_field): Add little-endian byte serialization for FieldElement (#7258) feat: allow unquoting TraitConstraint in trait impl position (#7395) feat(brillig): Hoist shared constants across functions to the global space (#7216) feat(LSP): auto-import via visible reexport (#7409) fix(brillig): Brillig entry point analysis and function specialization through duplication (#7277) chore: redo typo PR by maximevtush (#7425) fix(ssa): Accurately mark binary ops for hoisting and check Div/Mod against induction variable lower bound (#7396) feat!: remove bigint from stdlib (#7411)
AztecBot
added a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Feb 19, 2025
…m brillig (noir-lang/noir#7434) chore(docs): updating tutorials and other nits to beta.2 (noir-lang/noir#7405) feat: LSP hover for integer literals (noir-lang/noir#7368) feat(experimental): Compile match expressions (noir-lang/noir#7312) feat(acir_field): Add little-endian byte serialization for FieldElement (noir-lang/noir#7258) feat: allow unquoting TraitConstraint in trait impl position (noir-lang/noir#7395) feat(brillig): Hoist shared constants across functions to the global space (noir-lang/noir#7216) feat(LSP): auto-import via visible reexport (noir-lang/noir#7409) fix(brillig): Brillig entry point analysis and function specialization through duplication (noir-lang/noir#7277) chore: redo typo PR by maximevtush (noir-lang/noir#7425) fix(ssa): Accurately mark binary ops for hoisting and check Div/Mod against induction variable lower bound (noir-lang/noir#7396) feat!: remove bigint from stdlib (noir-lang/noir#7411) chore: bump aztec-packages commit (noir-lang/noir#7415) chore: deprecate `merkle` module of stdlib (noir-lang/noir#7413) chore(ci): lock aztec-packages commit in CI (noir-lang/noir#7414) feat: while statement (noir-lang/noir#7280)
AztecBot
added a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Feb 19, 2025
…oir-lang/noir#7434) chore(docs): updating tutorials and other nits to beta.2 (noir-lang/noir#7405) feat: LSP hover for integer literals (noir-lang/noir#7368) feat(experimental): Compile match expressions (noir-lang/noir#7312) feat(acir_field): Add little-endian byte serialization for FieldElement (noir-lang/noir#7258) feat: allow unquoting TraitConstraint in trait impl position (noir-lang/noir#7395) feat(brillig): Hoist shared constants across functions to the global space (noir-lang/noir#7216) feat(LSP): auto-import via visible reexport (noir-lang/noir#7409) fix(brillig): Brillig entry point analysis and function specialization through duplication (noir-lang/noir#7277) chore: redo typo PR by maximevtush (noir-lang/noir#7425) fix(ssa): Accurately mark binary ops for hoisting and check Div/Mod against induction variable lower bound (noir-lang/noir#7396) feat!: remove bigint from stdlib (noir-lang/noir#7411) chore: bump aztec-packages commit (noir-lang/noir#7415) chore: deprecate `merkle` module of stdlib (noir-lang/noir#7413) chore(ci): lock aztec-packages commit in CI (noir-lang/noir#7414) feat: while statement (noir-lang/noir#7280)
TomAFrench
added a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Feb 19, 2025
Automated pull of development from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE fix(performance): Remove redundant slice access check from brillig (noir-lang/noir#7434) chore(docs): updating tutorials and other nits to beta.2 (noir-lang/noir#7405) feat: LSP hover for integer literals (noir-lang/noir#7368) feat(experimental): Compile match expressions (noir-lang/noir#7312) feat(acir_field): Add little-endian byte serialization for FieldElement (noir-lang/noir#7258) feat: allow unquoting TraitConstraint in trait impl position (noir-lang/noir#7395) feat(brillig): Hoist shared constants across functions to the global space (noir-lang/noir#7216) feat(LSP): auto-import via visible reexport (noir-lang/noir#7409) fix(brillig): Brillig entry point analysis and function specialization through duplication (noir-lang/noir#7277) chore: redo typo PR by maximevtush (noir-lang/noir#7425) fix(ssa): Accurately mark binary ops for hoisting and check Div/Mod against induction variable lower bound (noir-lang/noir#7396) feat!: remove bigint from stdlib (noir-lang/noir#7411) chore: bump aztec-packages commit (noir-lang/noir#7415) chore: deprecate `merkle` module of stdlib (noir-lang/noir#7413) chore(ci): lock aztec-packages commit in CI (noir-lang/noir#7414) feat: while statement (noir-lang/noir#7280) END_COMMIT_OVERRIDE --------- Co-authored-by: Tom French <[email protected]>
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.
Description
Problem
Resolves #7378
Summary
This is a new feature but also a bug fix.
The bug was that if a type was directly visible from the current module it was offered for autocompletion. However, that didn't take into account if the type was actually in a crate that's in one of the current crate's dependencies. That's why in the original issue
protocol_types::traits::Packable
was offered: if it were a dependency it's good to suggest that... but it's not!Then the feature is that we now track all of an item's reexports (not just traits). Then, if the item isn't directly visible we search for that item's parent module's reexports. If there's one visible, we can suggest importing the item via the parent module's reexport. This is done recursively so that if the parent doesn't have a reexport but the grandparent module has one, that's used instead.
Here's how
Packable
is imported now:Additional Context
The changes here are bigger than just the above things because I also took the time to refactor and remove some code duplication that existed, and that now would have gotten even bigger. I tried to document the code as much as possible because the logic is getting more and more complex by the minute.
Documentation
Check one:
PR Checklist
cargo fmt
on default settings.