We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
use
case
The "extract variable" code action is offered in a couple of places where it shouldn't be. Inside use callbacks:
import gleam/result pub fn main() { use x <- result.try(todo) Ok(x + 1) }
Which transforms into:
import gleam/result pub fn main() { let value = Ok(x + 1) use x <- result.try(todo) value }
And also inside a case body:
pub fn main(result: Result(Int, String)) { case result { Ok(value) -> value + 1 Error(_) -> panic } }
Which becomes:
pub fn main(result: Result(Int, String)) { let int = value + 1 case result { Ok(value) -> int Error(_) -> panic } }
In both of these cases, a variable is referenced outside of the scope which it is created in, producing invalid Gleam code.
The text was updated successfully, but these errors were encountered:
Oh dear! Thank you
Sorry, something went wrong.
No branches or pull requests
The "extract variable" code action is offered in a couple of places where it shouldn't be. Inside
use
callbacks:Which transforms into:
And also inside a
case
body:Which becomes:
In both of these cases, a variable is referenced outside of the scope which it is created in, producing invalid Gleam code.
The text was updated successfully, but these errors were encountered: