You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right click the field of enum SomeEnum, for example zero, to rename. Enter new name and press enter. The field name is successfully renamed but its usages, .zero in the switch in this example, are not renamed.
Expected Behavior
Enum field itself and all the usages are renamed.
Relevant log output
No response
Notes
This would be the continuation of #2042. By #2043, the rename operation itself stopped failing. But it still does not work as expected.
The text was updated successfully, but these errors were encountered:
So this one is a little harder to tackle, because ZLS cannot infer enum types like the zig compiler can, and the compiler itself does not expose an API to query type information after the Sema phase.
Though maybe in cases like this where there can only be one obvious type that .zero belongs to, we can use the AST to find references? Worth trying.
Zig Version
0.14.0-dev.1820+ea527f7a8
ZLS Version
0.14.0-dev.167+063d7ff
Client / Code Editor / Extensions
Visual Studio Code-1.94.0
Steps to Reproduce and Observed Behavior
Init new project with
zig init
.Edit
main.zig
as follows:Right click the field of enum
SomeEnum
, for examplezero
, to rename. Enter new name and press enter. The field name is successfully renamed but its usages,.zero
in theswitch
in this example, are not renamed.Expected Behavior
Enum field itself and all the usages are renamed.
Relevant log output
No response
Notes
This would be the continuation of #2042. By #2043, the rename operation itself stopped failing. But it still does not work as expected.
The text was updated successfully, but these errors were encountered: