Skip to content
New issue

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

LSP Code Action: Desugar use expression #3314

Open
lpil opened this issue Jun 22, 2024 · 2 comments
Open

LSP Code Action: Desugar use expression #3314

lpil opened this issue Jun 22, 2024 · 2 comments
Labels
help wanted Contributions encouraged priority:medium

Comments

@lpil
Copy link
Member

lpil commented Jun 22, 2024

For example, turning:

use x <- result.map(Ok(1))
io.debug(x)

Into:

result.map(Ok(1), fn(x) { io.debug(x) })

Related to #3311

@giacomocavalieri
Copy link
Member

If you had multiple use expressions in a block what would the desired behaviour be?

use x <- result.try(Ok(1))
use y <- result.try(Error(1))
Ok(1)

Desugaring all of them? Or just the one where the cursor is?

result.try(Ok(1), fn(x) {
  use y <- result.try(Error(1))
  Ok(1)
})
// Or all the way down
result.try(Ok(1), fn(x) {
  result.try(Error(1), fn(y) {
    Ok(1)
  })
})

@lpil
Copy link
Member Author

lpil commented Jun 30, 2024

Just one please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Contributions encouraged priority:medium
Projects
Status: Unfinished
Development

No branches or pull requests

2 participants