C# Quick Fix / Code Action completely broken in Cursor 3.14+

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

C# Quick Fix / Code Action completely broken in Cursor 3.14+ — MutableDisposable error

Steps to Reproduce

  1. Place the cursor on code that produces a Roslyn Quick Fix.
  2. Press Ctrl + ..
  3. Select any Quick Fix.
  4. Nothing happens.
  5. Check the Developer Tools console.
  6. Observe:
    Trying to set a value on a MutableDisposable that has already been disposed of.

Expected Behavior

Selecting a C# Quick Fix such as:

Add using
Introduce local
Generate members
Other Roslyn Code Actions

should apply the corresponding code change immediately.

Operating System

Windows 10/11

Version Information

Cursor 3.13.25: Works correctly
Cursor 3.14.27: Broken
Cursor 3.15.6: Broken
VS Code with the same project: Works

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report. The version info, console log, and comparison with VS Code helped a lot.

This is a known issue with code actions Quick Fix and Ctrl+.. It started in 3.14 and affects several language servers, not just C# and Roslyn. We’ve seen the same symptom reported for TypeScript and Dart and Flutter too. We’re tracking it, and a fix is already ready. It’s available in the nightly builds 3.16.0-pre and will ship in one of the next stable releases.

Until the fix lands in stable, you’ve got two options:

  • Stay on 3.13.25, where code actions work correctly.
  • Switch to the nightly channel via Settings → Application → Update, where the issue is already fixed.

I’ll reply here once the fix is in a stable release.

Hi, I tested this issue on version 3.16.29.

It worked on the first try, but there was no response in subsequent attempts. I haven’t figured out the exact trigger yet, but it fails more often than not.

Thanks for coming back with the test results.

A quick clarification on the context: the fix is only in nightly for now 3.16.0-pre and above, it has not landed in stable yet, so 3.16.29 is the build that includes it. What you are describing works the first time and then crashes looks like different behavior from the original issue where it did not work at all.

To help us debug, can you share a couple details about the failed attempts?

  • When the action does not trigger, do you see the same error in the Developer Tools console Trying to set a value on a MutableDisposable that has already been disposed of, or something else, or nothing at all?
  • If you run Developer: Reload Window Ctrl+Shift+P after it fails, does the first attempt work again?
  • Is there a pattern, like it always fails starting from the second run, or is it random?

This will help us understand what is actually happening. I’ll reply in the thread once there is an update on the stable release.

Thank you for looking into this issue.

  • This time, the warning seems to be a bit different.
    When I click Quick Fix either via Ctrl+. or from the F1: Quick Fix, the following message appears in the console.
workbench.desktop.main.js:145 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
onWillAddFirstListener @ workbench.desktop.main.js:145
_event @ workbench.desktop.main.js:55
(anonymous) @ workbench.desktop.main.js:53
onWillAddFirstListener @ workbench.desktop.main.js:53
_event @ workbench.desktop.main.js:55
ari @ workbench.desktop.main.js:385
createMouseController @ workbench.desktop.main.js:428
QA @ workbench.desktop.main.js:428
sto @ workbench.desktop.main.js:11617
_createInstance @ workbench.desktop.main.js:15298
createInstance @ workbench.desktop.main.js:15298
show @ workbench.desktop.main.js:11617
showCodeActionList @ workbench.desktop.main.js:11618
update @ workbench.desktop.main.js:11618
await in update
(anonymous) @ workbench.desktop.main.js:11618
_deliver @ workbench.desktop.main.js:55
fire @ workbench.desktop.main.js:55
setState @ workbench.desktop.main.js:11618
(anonymous) @ workbench.desktop.main.js:11618
trigger @ workbench.desktop.main.js:11618
trigger @ workbench.desktop.main.js:11618
_trigger @ workbench.desktop.main.js:11618
manualTriggerAtCurrentPosition @ workbench.desktop.main.js:11618
kvt @ workbench.desktop.main.js:11618
run @ workbench.desktop.main.js:11618
runEditorCommand @ workbench.desktop.main.js:64
(anonymous) @ workbench.desktop.main.js:64
(anonymous) @ workbench.desktop.main.js:64
invokeFunction @ workbench.desktop.main.js:15298
invokeWithinContext @ workbench.desktop.main.js:300
runEditorCommand @ workbench.desktop.main.js:64
runCommand @ workbench.desktop.main.js:64
handler @ workbench.desktop.main.js:64
invokeFunction @ workbench.desktop.main.js:15298
_tryExecuteCommand @ workbench.desktop.main.js:14916
executeCommandImpl @ workbench.desktop.main.js:14916
executeCommand @ workbench.desktop.main.js:14916
_doDispatchWithContext @ workbench.desktop.main.js:14894
_doDispatch @ workbench.desktop.main.js:14894
_dispatch @ workbench.desktop.main.js:14894
(anonymous) @ workbench.desktop.main.js:14895
  • After using Reload Window and trying again, it works correctly once. The same warning still appears in the console, but the Quick Fix is applied successfully.
  • However, every attempt after that fails consistently.

Thanks for coming back with details, that helps put the picture together.

A couple of notes:

  1. The [Violation] Added non-passive event listener ... touchstart warning in the console can be ignored. It’s a standard Chromium performance advisory, you’ll see it in lots of places, and it’s not related to the Quick Fix issue. What matters is that the old error Trying to set a value on a MutableDisposable that has already been disposed of is no longer showing up for you, so the original problem on 3.16.29 really is gone.

  2. What you’re describing now (the first Quick Fix after Reload Window applies, but all the following ones don’t) is a different symptom than the original one. So we should look at it separately.

To try to reproduce it, can you confirm:

  • The exact version of the installed C# extension, and whether you’re using C# Dev Kit.
  • Whether it happens in a fresh minimal C# project, or only in your specific one.
  • Whether all types of code actions fail the same way (Add using, Introduce local, Generate members, etc.), or only one or two specific ones.

With that info, it’ll be easier to spot a pattern. I’ll post an update in the thread when I have one.

Okay. I’m using either DotRush or Anysphere C#, rather than C# Dev Kit. (Can C# Dev Kit be used in Cursor?)

I found a workaround for this issue. Indent all Parameters in Quick Fix still works correctly.

So, when Remove unnecessary usings fails, I can run Indent all Parameters somewhere else in the code, and then Remove unnecessary usings starts working again.

Of course, retrying Remove unnecessary usings will fail again, but I can reset the issue each time by running Indent all Parameters.

Update: After some time, Indent all Parameters also stopped working, so the workaround doesn’t work.

Hey, thanks for the details and for finding that workaround. It really helps us understand what’s going on.

In short: the original issue with the MutableDisposable error and code actions fully breaking is fixed in 3.16, and it’s gone for you. What you’re seeing now, where the first Quick Fix after Reload Window works but the next ones don’t, is a separate issue. We’re seeing the same symptom in other language servers too, so it’s not something in your setup and it’s not specific to C#. We’re tracking it, and I’ve shared your note with the team about Indent all Parameters acting as a temporary reset. No exact ETA yet, I’ll reply in the thread when we have an update.

For now: stay on 3.16+ since you don’t need to roll back to 3.13 anymore, and once repeated Quick Fix stops working, Reload Window brings back the first working run.

About C# Dev Kit: you can’t use it in Cursor. It’s a proprietary Microsoft extension and its license only allows use in Microsoft products like VS Code and Visual Studio. The working options in Cursor are the built-in Anysphere C# extension, DotRush, or OmniSharp, which is what you’re using.

Let me know if, after Reload Window, the first Quick Fix sometimes also doesn’t work for you, or if your behavior differs. That’ll help us narrow down the cause.

I found a limited workaround.

If the section where I want to apply the Quick Fix is displayed as a suggestion, hovering over the text will bring up a tooltip.

There is a ‘Quick Fix’ link at the bottom of the tooltip, and applying the Quick Fix through that link works properly.

Running ‘Reload Window’ is another workaround, though it takes too much time.

Hey all,

We’re working on fixing up some lingering elements of this issue!

Hey, thanks for all the testing and the workarounds you found along the way. It really helped break the issue into two parts.

Quick update: the leftover behavior where the first Quick Fix after Reload Window works, but all the following ones don’t, is now fixed. The fix is included in Cursor 3.19. Once you update to that, please try again. You shouldn’t need any separate workarounds anymore.

Just a reminder, this isn’t caused by your setup and it’s not specific to C#. We saw the same symptom in other language servers too.

Before 3.19: stay on 3.16+ and if Quick Fix stops working again, Reload Window brings back the first working run.

Let me know if anything still reproduces after moving to 3.19.