-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[move-ide] Fixed module id name construction (#16220)
## Description This PR fixes a problem related to module ID strings between parsed AST and typing AST not being the same. In the typing AST name, if the module has both the package address and the package name, the ID string will be `(pkg_name=pkg_addres)::mod_name` whereas the parsing AST it only has the name (as address is not resolved). When using module ID as a map key this causes discrepancy - module info inserted with one ID is unavailable when queried with the other ID. This PR unifies both IDs. This PR also adds back parallelism accidentally removed in #16178 (move-analyzer does not work without this as the requests are served in separate threads). ## Test Plan Tried to create a unit test for the module ID string fix but was not successful. Nevertheless, without this fix, opening `sui/sui_programmability/examples/capy/` in the IDE crashes move-analyzer and with this fix everything works correctly.
- Loading branch information
Showing
4 changed files
with
135 additions
and
93 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
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
10 changes: 10 additions & 0 deletions
10
external-crates/move/crates/move-analyzer/tests/mod-ident-uniform/Move.toml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "ModIdentUniform" | ||
version = "0.0.1" | ||
|
||
[dependencies] | ||
MoveStdlib = { local = "../../../move-stdlib/", addr_subst = { "std" = "0x1" } } | ||
|
||
[addresses] | ||
ModIdentUniform = "0xCAFE" | ||
ConflicitingAddress = "0xCAFE" |
2 changes: 2 additions & 0 deletions
2
external-crates/move/crates/move-analyzer/tests/mod-ident-uniform/sources/M1.move
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module ModIdentUniform::M1 { | ||
} |