Comments (4)
I spent some time debugging, and here are some notes for when I can next pick it back up.
Code model generation triggered from RDT.BeforeSave to construct a model for cleaning works fine and runs on the UI thread.
Code model generation triggered from RDT.AfterSave to construct an updated model for digging sometimes fails and runs on the background thread.
The AfterSave scenario will always re-generate the code model currently due to SpadeToolWindow.ConditionallyUpdateCodeModel's call to _codeModelManager.OnDocumentChanged(Document) within a refresh scenario. Taking out this line of code is a good optimization as the logic to catch a stale document from LineChanged seems robust enough that this force refresh shouldn't(tm) be necessary.
Bypassing the re-generation avoids the error, but if cleaning caused any code model changes then re-generation would be required and the hang will still be exhibited.
Experimented with just making CodeModelBuilder.RetrieveCodeRegions run on the UI thread, but the same hang was exhibited.
A performance option to disable asynchronous code model loading might be a good idea at this point. Alternatively, it may be worthwhile to explore if the code model can be generated synchronously when called from a refresh context.
from codemaid.
Checked in a performance option for loading models asynchronously (on by default). This can be disabled which should force the UI thread to be used for building the model and work around this issue.
from codemaid.
Hi codecadwallader,
Thx for your amazing extension, I can't work without Spade since I installed it 6 years ago !
Took me a while but I discovered that I really have to uncheck "Load models asynchronously" because it took about 6-8 seconds to finish refreshing/loading when saving. It was just too annoying because I save my work very often. So unchecked this option was the solution.
from codemaid.
@FlouFlou Cool, I'm glad to hear that you've been enjoying it. :) Also thanks for sharing that flipping that setting was helpful for you as it may be helpful for others.
from codemaid.
Related Issues (20)
- Sort Lines ignores leading tick ' HOT 2
- Unable to run extension during development
- Progress window text remains cut off
- codemaid.net redirects to the VS Marketplace and linked images are broken HOT 1
- XML Comment formatting eats spacing inside `<code>` block HOT 1
- [[unlikely]] or [[likely]] after if statements break the formatting
- Smart backspace feature
- Shortcut Ctrl+M, Z (Reorganize Active Document) not working on records
- Feature Request: Add option for conditional per-file Automatic Cleanup on Save based on comment at top of file
- Spade takes too long to render document outline. Re-pinning/Re-docking the window seems to solve it. HOT 7
- digging window of cmake project show nothing
- Wrong cleaning up in C# HOT 1
- CodeMaid Causes Visual Studio 22 17.9.3 To Hang and Crash
- Documentation link broken? HOT 2
- Option to Keeping aligned spaces?
- TryDefault regex parsing exception
- CodeMaid Reorganizing Issue VS 2022 / 12.0.344 HOT 1
- Additional "Insert" menu option for toggling
- "Find in solution explorer" not working since VS2022 17.10.0 HOT 2
- Images link broken
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codemaid.