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

Rename from cursor where LHS is a constructor call #505

Open
toinehartman opened this issue Nov 6, 2024 · 0 comments
Open

Rename from cursor where LHS is a constructor call #505

toinehartman opened this issue Nov 6, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@toinehartman
Copy link
Contributor

Describe the bug

Rename refactoring does not support initiating a renaming with the cursor on a field access, when the LHS of the field access is a constructor call.

To Reproduce

The following tests describe this behaviour, but currently fail:

test bool constructorCallHasField() = testRenameOccurrences({0, 1}, "
    bool b = f(8) has foo;
", decls = "data Foo = f(int foo);");

test bool constructorCallRenameField() = testRenameOccurrences({0, 1}, "
    int x = f(8).foo;
", decls = "data Foo = f(int foo);");

test bool constructorCallRenameKeywordField() = testRenameOccurrences({0, 1, 2}, "
    int x = f(foo = 8).foo;
", decls = "data Foo = f(int foo = 0);");

Expected behavior
Rename the fields, like the LHS is a variable use (with ADT type).

@toinehartman toinehartman added the bug Something isn't working label Nov 6, 2024
@toinehartman toinehartman self-assigned this Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant