Giter Site home page Giter Site logo

Comments (3)

jasonmalinowski avatar jasonmalinowski commented on July 28, 2024 1

@AArnott Happy to do so! And in my case, even just a small doc update or something would have been useful. Honestly, what was the trickiest part was actually finding any docs saying what should be done; if there was simple step-by-step that was "override these methods, do this", you could easily have a note there which is "you need a non-default constructor to make the analyzer happy", and I wouldn't have given it much of a second thought.

from vssdk-analyzers.

AArnott avatar AArnott commented on July 28, 2024

Thanks for the great write-up of the problem you found and suggestions for the resolution.
Async tool windows are indeed one of the more complicated things both to test for (which is why I took shortcuts that I thought were heuristically sufficient) and IIRC we don't offer a code fix for it.
I suspect we can take your suggestions though.

from vssdk-analyzers.

reduckted avatar reduckted commented on July 28, 2024

I think I've come across a similar bug, so rather than opening a new issue, I'll add to this one.

The Community.VisualStudio.Toolkit is about to introduce helper classes for creating async tool windows: madskristensen/Community.VisualStudio.Toolkit#25

The only downside to those helper classes is that the VSSDK003 analyzer warning is produced, even though the tool windows are being created asynchronously.

The PR I linked above contains the full sample code, but the two key parts are:

  1. You inherit from ToolkitPackage instead of AsyncPackage.
  2. The tool window has a parameterless constructor.

Under the hood, the ToolkitPackage class creates the tool windows asynchronously. Any asynchronously resolved services that are needed by the tool window are resolved during the InitializeToolWindowAsync method and the helper class implementation uses those services to create the tool window's Content property value rather than passing those services to the tool window's constructor.

from vssdk-analyzers.

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.