Skip to content
This repository has been archived by the owner on Apr 8, 2019. It is now read-only.

VB autoproperties are not analyzed. #34

Open
CyrusNajmabadi opened this issue Feb 3, 2019 · 7 comments
Open

VB autoproperties are not analyzed. #34

CyrusNajmabadi opened this issue Feb 3, 2019 · 7 comments

Comments

@CyrusNajmabadi
Copy link

Simple repro:

Public Class Class1
    Public Property A As Integer
End Class

Expected:
Analyzer complains that 'A' is not part of the publicapi file.

Actual:
Analyzer does not complain at all.

@CyrusNajmabadi
Copy link
Author

Tagging @mavasani @sharwell

Note: i have a potential fix here. I've verified it manually. But this repo doesn't have VB tests, so i'm not sure how to make a full test for it.

@mavasani
Copy link

mavasani commented Feb 3, 2019

@CyrusNajmabadi If you are looking at enhancing the public API analyzer that we use for Roslyn.sln, then you want to look in the roslyn-analyzers repo at https://github.com/dotnet/roslyn-analyzers/blob/master/src/Roslyn.Diagnostics.Analyzers/Core/DeclarePublicAPIAnalyzer.cs. We have an open community PR to add the same functionality in roslyn-analyzers repo, but that change proposes a breaking change to the public API text, which seems much less preferable.

Just as an FYI: The public API analyzer in this repo (PublicApiAnalyzer) was a fork from the original implementation in roslyn-analyzers repo, primarily to enable publishing a separate NuGet package just with this analyzer (Roslyn.Diagnostics.Analyzers NuGet package also contains other Roslyn.sln specific analyzers). We had a work item somewhere to consolidate both analyzers so we avoid this confusion, but that hasn't happened yet.

@CyrusNajmabadi
Copy link
Author

Ah, good to know. I'll move things over there.

@CyrusNajmabadi
Copy link
Author

@mavasani can you help me with that repo. The instructions say this:

    Clone the repository
    Restore and build: build.cmd
    Execute tests: test.cmd

However, neither build.cmd or test.cmd exist. There is a cibuild.cmd. But it fails for me with:

  Feeds used:
    C:\Users\cyrus\AppData\Local\NuGet\Cache
    C:\Users\cyrus\.nuget\packages\
    https://api.nuget.org/v3/index.json
    https://www.myget.org/F/roslyn-nightly/
    https://www.myget.org/F/dotnet-core/
    https://dotnet.myget.org/F/roslyn/api/v3/index.json

  Error loading lock file 'C:\github\roslyn-analyzers\src\Microsoft.ApiDesignGuidelines.Analyzers\Core\project.lock.json' : Value cannot be null.

@CyrusNajmabadi
Copy link
Author

Ignore me entirely. my fork is hugely out of date.

@CyrusNajmabadi
Copy link
Author

Dupe of dotnet/roslyn-analyzers#821

@sharwell
Copy link
Member

sharwell commented Feb 3, 2019

@CyrusNajmabadi Not a duplicate of dotnet/roslyn-analyzers. This is an extracted implementation of the Public API Analyzer that works is any repository, as opposed to the much more limited implementation in roslyn-analyzers.

@sharwell sharwell reopened this Feb 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants