Git Product home page Git Product logo

Comments (4)

codecadwallader avatar codecadwallader commented on July 30, 2024

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.

codecadwallader avatar codecadwallader commented on July 30, 2024

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.

FlouFlou avatar FlouFlou commented on July 30, 2024

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.

codecadwallader avatar codecadwallader commented on July 30, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.