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

Diagnostic that spans across projects #281

Open
sharwell opened this issue Feb 6, 2015 · 2 comments
Open

Diagnostic that spans across projects #281

sharwell opened this issue Feb 6, 2015 · 2 comments

Comments

@sharwell
Copy link
Member

sharwell commented Feb 6, 2015

I'd like to implement a diagnostic analyzer that spans across Projects in a Solution. Is it possible to get this information within a diagnostic analyzer?

For reference, this is part of implementing the following:
openstacknetsdk/OpenStackNetAnalyzers#16

@tmeschter
Copy link
Contributor

Analyzers are currently project-centric; they can't "see" anything outside of the project currently being built, including other projects.

That being said, there may be another approach that can achieve what you want right now. Projects now support additional files--text files that aren't source code but are passed to the compilers and available to analyzers. You could have the .NET SDK projects share an additional file documenting the set of expected classes and members, and an analyzer that complains if they don't.

The Roslyn projects currently use this approach to enforce that the public API surface is documented in an additional file; this makes changes to the public API very obvious in code reviews and such. See https://github.com/dotnet/roslyn/blob/master/src/Diagnostics/Roslyn/Core/ApiDesign/DeclarePublicAPIAnalyzer.cs.

@srivatsn srivatsn added this to the Unknown milestone Mar 13, 2015
@srivatsn
Copy link
Contributor

Solution wide analyzers are not currently supported. We'll use this issue to track the feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants