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

[move-ide] Fixed auto-completion for unresolved method chains #21603

Merged
merged 2 commits into from
Mar 25, 2025

Conversation

awelc
Copy link
Contributor

@awelc awelc commented Mar 25, 2025

Description

When method's access chain was incorrect, no auto-completion was generated even for correctly typed prefix of this chain, such as in this example:

    public struct SomeStruct {
        some_field: u64,
    }

    public fun bar(_some_struct: &SomeStruct):u64 {
        42
    }

    public fun foo(some_struct: &mut SomeStruct): u64 {
        some_struct.
        some_struct.bar()
    }

Additionally, this behavior was inconsistent with the auto-completion behavior for a similar chain but ending in a (supposed) field access instead of a method call, where auto-completion for the dot following the first some_struct would be generated:

    public fun foo(some_struct: &mut SomeStruct): u64 {
        some_struct.
        some_struct.some_field
    }

This PR fixes this issue

Test plan

Added a new test. All tests must pass

@awelc awelc requested a review from cgswords March 25, 2025 14:40
Copy link

vercel bot commented Mar 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 25, 2025 3:01pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Mar 25, 2025 3:01pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Mar 25, 2025 3:01pm

@awelc awelc self-assigned this Mar 25, 2025
@awelc awelc temporarily deployed to sui-typescript-aws-kms-test-env March 25, 2025 14:40 — with GitHub Actions Inactive
Copy link
Contributor

@cgswords cgswords left a comment

Choose a reason for hiding this comment

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

LGTM.

@awelc awelc merged commit 813dbd8 into main Mar 25, 2025
47 checks passed
@awelc awelc deleted the aw/move-ide-method-completion-fix branch March 25, 2025 21:22
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.

2 participants