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 auto-format breaks handle definitions #4678

Closed
andreystepanov opened this issue Feb 8, 2024 · 2 comments
Closed

LSP auto-format breaks handle definitions #4678

andreystepanov opened this issue Feb 8, 2024 · 2 comments
Assignees

Comments

@andreystepanov
Copy link

Quick example to reproduce it:

ability Counter where
  next : {Counter} Nat

Counter.impl value request = 
  match request with
    { result }  -> result
    { next -> resume } -> 
      handle resume value with Counter.impl (value + 1)

countFrom n f = do
  handle !f with Counter.impl n

Gets formatted into:

ability Counter where next : {Counter} Nat

Counter.impl value = cases
  { result }         -> result
  { next -> resume } -> handle resume value with Counter.impl (value Nat.+ 1) with Counter.impl (value + 1)

countFrom n f = do handle !f with impl n with Counter.impl n

And ucm error is:

  Loading changes detected in ~/dev/scratch.u.                                                            
                                                                
  I found a closing 'with' here without a matching 'handle' or 'match'.                                                              
      5 |   { next -> resume } -> handle resume value with Counter.impl (value Nat.+ 1) with Counter.impl (value + 1)                                                
@ChrisPenner
Copy link
Contributor

ChrisPenner commented Feb 8, 2024

I believe I fixed this one here: #4671, so try pulling the latest release and feel free to re-open if it's still an issue 🎉

Thanks for the report and reproduction though!

@ChrisPenner ChrisPenner self-assigned this Feb 8, 2024
@andreystepanov
Copy link
Author

andreystepanov commented Feb 9, 2024

Oh, my bad, sorry.

After upgrading it's no longer an issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants