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

Corrupted buffer after repeated application of "Adjust type" code action #6018

Open
keynmol opened this issue Jan 13, 2024 · 1 comment
Open
Labels
bug Something that is making a piece of functionality unusable good first issue presentation-compiler Something relating to the presentation compiler

Comments

@keynmol
Copy link
Contributor

keynmol commented Jan 13, 2024

Describe the bug

Take this code:

case class WithEffects[A](a: A)
object WithEffects:
  def hello[A](f: => A): WithEffects[A] = WithEffects(f)

def hello(a: Int)(using String): WithEffects[Int]: WithEffects[Int] = 
  WithEffects.hello:
    25

Now apply "adjust type" code action twice on 25 without saving in-between
CleanShot 2024-01-13 at 14 36 23

Expected behavior

No response

Operating system

None

Editor/Extension

Nvim (nvim-metals)

Version of Metals

1.2.0+62-0ec94060-SNAPSHOT

Extra context or search terms

code action, adjust type, corrupt state, scala 3

@tgodzik tgodzik added the bug Something that is making a piece of functionality unusable label Jan 13, 2024
@tgodzik
Copy link
Contributor

tgodzik commented Jan 13, 2024

Thanks for reporting! We use the diagnostics for triggering the code action. We should somehow make sure if the code action wasn't already applied or at least make it idempotent.

@tgodzik tgodzik added presentation-compiler Something relating to the presentation compiler good first issue labels Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is making a piece of functionality unusable good first issue presentation-compiler Something relating to the presentation compiler
Projects
None yet
Development

No branches or pull requests

2 participants