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
When renaming a type alias, references to the alias used as a constructor function are not renamed.
Expected Behavior
Given this code:
importJson.DecodeasDecodeimportJson.Decode.PipelineasDecodetype alias MyRecord={ score :Int}decodeStuff:Decode.DecoderMyRecorddecodeStuff =Decode.succeed MyRecord|>Decode.required "score"Decode.int
Renaming MyReccorrd on the first line to Score should result in this (imports removed for brevity):
type alias Score={ data :Int}decodeStuff:Decode.DecoderScoredecodeStuff =Decode.succeed Score|>Decode.required "data"Decode.int
but it does not change the reference passed to Decode.succeed.
Current Behavior
The result of renaming the type alias to Score is incorrect:
type alias Score={ data :Int}decodeStuff:Decode.DecoderScoredecodeStuff =Decode.succeed MyRecord|>Decode.required "data"Decode.int
Possible Solution
I haven't looked at the code for this project so I'd just be conjecturing. :)
If given some direction, I could at least try to take a stab at the fix!
Steps to Reproduce (for bugs)
An even more minimal repro:
type alias MyRecord={ data :Int}stuff:MyRecordstuff =MyRecord1
Same problem; renaming the type alias does not change the last line of this snippet.
Context
It's a nuisance, more than anything, but when renaming multiple things at once and forgetting about this issue (say, the reference is in another file) things can get confusingly broken. Especially in the case where I'd realized two types were named "backward" and tried to swap their names.
Your Environment
Version used: 2.7.0
Editor used: NeoVim 0.9.0, LuaJIT 2.1.0-beta3
Environment name and version: Node 18.16.0
Operating System and version: Garuda Linux (rolling, Arch-based) -- kernel 6.2.13-zen-1-zen
The text was updated successfully, but these errors were encountered:
When renaming a type alias, references to the alias used as a constructor function are not renamed.
Expected Behavior
Given this code:
Renaming
MyReccorrd
on the first line toScore
should result in this (imports removed for brevity):but it does not change the reference passed to
Decode.succeed
.Current Behavior
The result of renaming the type alias to
Score
is incorrect:Possible Solution
I haven't looked at the code for this project so I'd just be conjecturing. :)
If given some direction, I could at least try to take a stab at the fix!
Steps to Reproduce (for bugs)
An even more minimal repro:
Same problem; renaming the type alias does not change the last line of this snippet.
Context
It's a nuisance, more than anything, but when renaming multiple things at once and forgetting about this issue (say, the reference is in another file) things can get confusingly broken. Especially in the case where I'd realized two types were named "backward" and tried to swap their names.
Your Environment
The text was updated successfully, but these errors were encountered: