Comments (3)
@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.
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.
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:
- You inherit from
ToolkitPackage
instead ofAsyncPackage
. - 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)
- VSSDK006CheckServicesExistAnalyzer throwing ArgumentException: Syntax node is not within syntax tree HOT 1
- Analyzers static ctor crashes with inability to read its own field HOT 10
- VSSDK006 fires when validation is in another method HOT 1
- VSSDK006 does not recognize `is null` check HOT 1
- VSSDK001DeriveFromAsyncPackageCodeFix encountered an error and has been disabled HOT 1
- VSSDK002PackageRegistrationMatchesBaseTypeCodeFix encountered an error and has been disabled HOT 1
- VSSDK006CheckServicesExistCodeFix encountered an error and has been disabled HOT 1
- The type initializer for 'Microsoft.VisualStudio.SDK.Analyzers.VSSDK001DeriveFromAsyncPackageCodeFix' threw an exception HOT 5
- VSTHRD010: false warning for IVsInvalidateCachedCommandState.InvalidateSpecificCommandUIState(VSCommand)
- Analyzer proposal: Catch uses of older VisualStudioServices version
- System.Object (and other types) not defined when running tests (missing assembly references) HOT 3
- Code Fix Service Gold Bar Error HOT 1
- VSSDK003 is created despite override GetAsyncToolWindowFactory being present HOT 2
- VsixCompatibilityAnalyzer target/task leaving file lock on the vsix file HOT 3
- This repo is missing important files
- VSSDK006 does not recognize null check in combination with ternary condition
- Analyzer to encourage canceling work on shutdown
- VSSDK006 analyzer can take a very long time to run
- False positive in "Invoke single-threaded types on Main thread"
- VSTHRD010 code fix fails inside a lambda
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 vssdk-analyzers.