codecadwallader / codemaid

CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.
http://www.codemaid.net
GNU Lesser General Public License v3.0
1.9k stars 358 forks source link

Spade hangs Visual Studio if you switch between long files #1015

Open Hermholtz opened 1 year ago

Hermholtz commented 1 year ago

Environment

Description

CodeMaid Spade hangs the whole Visual Studio if you switch between long source files too quickly/too frequently.

Steps to recreate

  1. Have at least 2 (preferrably more) source files of at least 1000 lines and many properties, methods etc. open in tabs.
  2. Activate CodeMaid Spade, you'll see the spinner and eventually it'll show the source structure.
  3. Now try to navigate multiple times with CTRL+TAB to other source files, do it quickly so that the spinner does not go away (Spade does not finish parsing the code).
  4. Observe that Visual Studio hangs at some point (rather quickly, I can invoke this in ~5 seconds).

NOTE the CTRL+TAB is meant only to show the repro. It happens during normal usage of VS such as CTRL+click (go to definition), go back etc.

Current behavior

Visual Studio hangs for good and all unsaved changes to source files are lost.

Expected behavior

Spade correctly aborts (cancels) parsing and rendering current file once another editor tab is activated.

Additional info

This is not a new behavior, I've observed it for years, also in previous versions of VS/CodeMaid, but it started to affect me really badly. Maybe I'm too fast for it, or my coding habits are bad, or the source files are too long, but still I think it shouldn't hang VS under any circumstances. Also, the hardware is quite adequate - Ryzen 7, 32 GB of RAM, NVMe, no bottlenecks here.

Thank you.

codecadwallader commented 11 months ago

Thanks for reporting the issue. It is a known limitation that large files are not supported very well.