-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bindings API improvements and resolution across imported files (#1053)
This PR implements the following changes: - Add Solidity binding rules to resolve bindings across imported files. - Add a new trait to resolve paths for imported files in source units. - Implement a no-op path resolver and one that can resolve only relative imports as specified [here](https://docs.soliditylang.org/en/v0.8.26/path-resolution.html#relative-imports). - Change all bindings test infrastructure (both snapshots and assertions) to support providing multiple Solidity source files from a single file `.sol` file. - When resolving a reference to a definition, always pick the longest path available. This ensures that we get the actual definition of the identifier reference and not another definition along the path (eg. an import alias). - Remove the `Handle` interface from the bindings and replace it with separate `Definition` and `Reference`. - Support definiens nodes in the rules file (and add them for the existing Solidity rules) to get to the CST node actually being defined by a given identifier. - Add a getter to `Definition` to get the definiens CST node. - Provide separate functions to lookup either a `Definition` or a `Reference` given a cursor (it was previously not possible to retrieve both of them from an identifier that connected to separate stack graph nodes) --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Omar Tawfik <[email protected]> Co-authored-by: Igor Matuszewski <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Antony Blakey <[email protected]>
- Loading branch information
1 parent
cb36a4b
commit 00b2aa3
Showing
64 changed files
with
1,434 additions
and
656 deletions.
There are no files selected for viewing
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
86 changes: 0 additions & 86 deletions
86
crates/codegen/runtime/cargo/src/runtime/cli/commands/bindings.rs
This file was deleted.
Oops, something went wrong.
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 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 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 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
Oops, something went wrong.