Skip to content

Conversation

@stefan-mysten
Copy link
Contributor

Description

This PR brings a few fixes to move-analyzer and a small optimization to reuse a regex rather than creating a new one every time.

Test plan

Existing tests.


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • Indexing Framework:

@stefan-mysten stefan-mysten self-assigned this Dec 2, 2025
@stefan-mysten stefan-mysten temporarily deployed to sui-typescript-aws-kms-test-env December 2, 2025 23:56 — with GitHub Actions Inactive
@vercel
Copy link

vercel bot commented Dec 2, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sui-docs Ready Ready Preview Comment Dec 3, 2025 0:00am
2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
multisig-toolkit Ignored Ignored Preview Dec 3, 2025 0:00am
sui-kiosk Ignored Ignored Preview Dec 3, 2025 0:00am

Comment on lines -364 to -366
// TODO: we need to rework on loading the root pkg only once.
let dependencies = root_pkg.packages();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved it up a bit

Comment on lines 117 to +126
let clean = strip_comments(contents);
let mut set = HashSet::new();

// This matches `module a::b {}`, and `module a::b;` cases.
// In both cases, the match is the 2nd group (so `match.get(1)`)
let regex = Regex::new(MODULE_REGEX).unwrap();

for cap in regex.captures_iter(&clean) {
set.insert(cap[1].to_string());
}

Ok(set
.into_iter()
.filter(|name| !is_address_like(name.as_str()))
Ok(MODULE_REGEX_COMPILED
.captures_iter(&clean)
.filter_map(|cap| {
let name = &cap[1];
(!is_address_like(name)).then(|| name.to_string())
})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be slightly more optimized, particularly that we're reusing the REGEX rather than creating a new one every time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant