Related to #5891 and could be fixed in the same PR. I think that we could offer code action with name like Inline all constant usages on constant definition. For example:
const x = 0
// ^ Trigger code action here
pub fn main() {
echo x
wibble(x)
}
would result in this code:
pub fn main() {
echo 0
wibble(0)
}
Open questions
- Should it delete constant definition?
- Should we be able to trigger it only on definition or on usages too?
Related to #5891 and could be fixed in the same PR. I think that we could offer code action with name like
Inline all constant usageson constant definition. For example:would result in this code:
Open questions