mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-28 20:14:45 +00:00
926 B
926 B
Available Code Actions
eliminate_unused_vars
This code action will eliminate unused variables in code.
foo = 1
for! 0..3, i =>
print! 1
↓
for! 0..3, _ =>
print! 1
change_case
This code action will change non-snake case variables to snake case.
fooBar = 1
↓
foo_bar = 1
inline_variables
This code action will inline variables.
two = 1 + 1
print! two
print! two * 1
↓
print! 1 + 1
print!((1 + 1) * 1)
extract_variables
This code action will extract variables.
print! |1 + 1| # |...| is selected
↓
new_var = 1 + 1
print! new_var
extract_functions
This code action will extract functions.
if foo, do:
# |...| is selected
|for arr, i =>
...
bar()|
↓
new_func() =
for arr, i =>
...
bar()
if foo, do:
new_func()