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

Spade takes too long to render document outline. Re-pinning/Re-docking the window seems to solve it. #1044

Open
Nirvaxstiel opened this issue Feb 28, 2024 · 7 comments

Comments

@Nirvaxstiel
Copy link

Nirvaxstiel commented Feb 28, 2024

Environment

  • Visual Studio version: [Visual Studio 2022 Community & Enterprise]
  • CodeMaid version: [12.0,300]
  • Code language: [C#]

Description

Spade takes too long to render document outline on save. However, redocking, pinning & unpinning spade window solves the issue. It may be due to monolithic code base but I can't tell for sure.

Steps to recreate

  1. Pin Spade to the side
  2. Make changes to existing C# file.
  3. Save File
  4. Stuck rendering the document
  5. Unpin the spade window (this will hide it and push it to the side)
  6. Open spade from the side as a floating window and observe the document updated.

Current behavior

Takes too long to render the outline. I have not timed it, but the last time I tried going for a coffee break while it does this, it did not finish the job even after I was done brewing.

Expected behavior

Show some explicit messages on what is going on, or default to previous state and also show an error message.

@kiemzbui
Copy link

kiemzbui commented Mar 1, 2024

The same behavior is also apparent on my machine when I use the spade to manually reorder members (drag and drop).

I've been closing and reopening the spade with a hotkey to get it to refresh, but the pin and unpin also gets the spade to refresh its view. It seems like the spade reloads the outline very quickly but the spade window isn't notified of the change and the UI gets stuck in the 'refreshing...' state

@Nirvaxstiel
Copy link
Author

Nirvaxstiel commented Mar 5, 2024

Updated to VS 17.9.2. Now, it sometimes renders and at other times, it gets stuck again.

Apparently if I open documents by horizontal view, just unfocusing and re-focusing the working document fixes it. (i.e. If the left side is the issue, click the right side, and then back to the left side again.)

@jacobh12349
Copy link

jacobh12349 commented Mar 26, 2024

Ya, this has been happening for me lately too, it's probably a bug in the extension code.

@cat-turnec9
Copy link

I've noticed this behaviour consistently in VS 17.9.6. After I make any change to a file, launching CodeMaid Spade will result in the pane getting 'stuck' loading. If I close and re-open the pane, it loads fine. Then any change I make in Spade (like reordering methods, etc) will result in getting stuck loading again, to be fixed by closing and re-opening the pane.

@jacobh12349
Copy link

jacobh12349 commented May 1, 2024

Ya, this has been happening for me lately too, it's probably a bug in the extension code.

I didn't code this extension, but I'm pretty good at coding, so I did a little debugging in this extension's source code, and I found why this is happening, it happens on this line of code.
For some reason, the Document and the codeModel.Document aren't equal here after it finishes building the code model asynchronously, so the UpdateViewModelRawCodeItems method doesn't get called here, so it doesn't load it and just keeps the loading thing there.
I made a temporary fix for this on just my computer by changing the if (Document == codeModel.Document) to if (Document.FullName == codeModel.Document.FullName) but that shouldn't need to be done though, so the creator of this extension just needs to figure out why those Documents aren't equal there to fix this bug.

if (Document == codeModel.Document)

@jacobh12349
Copy link

@codecadwallader

Ya, this has been happening for me lately too, it's probably a bug in the extension code.

I didn't code this extension, but I'm pretty good at coding, so I did a little debugging with this extension's source code, and I found why this is happening, it happens on this line of code. For some reason, the Document and the codeModel.Document aren't equal here after it finishes building the code model asynchronously, so the UpdateViewModelRawCodeItems method doesn't get called here, so it doesn't load it, and just keeps the loading thing there. I made a temporary fix for this on just my computer by changing the if (Document == codeModel.Document) to if (Document.FullName == codeModel.Document.FullName) but that shouldn't need to be done though, so the creator of the extension just needs to figure out why those Documents aren't equal there to fix this bug.

if (Document == codeModel.Document)

@codecadwallader

@michel-pliant
Copy link

Same problem here with VS 17.9.6

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

5 participants