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

Quick action to move symbols from PublicApi.Unshipped.txt to PublicApi.Shipped.txt #3226

Open
josh-degraw opened this issue Jan 20, 2020 · 8 comments

Comments

@josh-degraw
Copy link

Analyzer package

Microsoft.CodeAnalysis.PublicApiAnalyzers

Package Version

v2.9.8 (Latest)

I'm not sure if this is even possible or not, but it would be nice to be able to have a cleaner method of promoting entries in the PublicApi.Unshipped.txt to PublicApi.Shipped.txt. I'm thinking of something like a quick action or context action to be able to move all records in the PublicAPI.Unshipped.txt file to PublicApi.Shipped.txt when shipping. If that's not possible, maybe adding a diagnostic that defaults to "info/message" level that just gives the developer the ability to move entries between the files, in order to preserve the "correct" structure and organization of the file.

Until now, to do this I have just deleted everything in both files and ran the existing codefix to add everything in the project to the Unshipped file, and then copied them all over to the Shipped file, which isn't that much extra work, but it is a bit of a nuisance, and it would be nice to have an alternative method if possible.

@Evangelink
Copy link
Member

Is it possible to have quick actions on text files? At worst we can have the quick action on the code member not the text file.

@sharwell
Copy link
Member

Is it possible to have quick actions on text files?

It is not, and it's quite frustrating when it comes to this particular analyzer.

@sharwell
Copy link
Member

Marking as blocked on dotnet/roslyn#29268, although supporting code fixes in non-code documents would be equally usable for this.

@TimothyMothra
Copy link

@mavasani
Copy link
Contributor

I believe @333fred also has a script that does this for Roslyn repo. Fred, can you give a pointer?

@333fred
Copy link
Member

333fred commented Feb 25, 2020

Roslyn has one: https://github.com/dotnet/roslyn/blob/master/scripts/PublicApi/README.md

@AshleighAdams
Copy link

I wasn't happy with the complex powershell based one, and wanted a simpler and more platform agnostic one in Bash (irony anyone? thanks Git for Windows!), so I came up with this: https://github.com/AshleighAdams/Verlite/blob/master/src/Verlite.Core/mark-shipped.sh

@bitbonk
Copy link

bitbonk commented Dec 2, 2021

It would be very helpful if moving APIs from unshipped to shipped was part of the "tooling experience" for the public API tracking feature of Microsoft.CodeAnalysis.PublicApiAnalyzers. Of course I can copy and use one of the above scripts in our repos but it is doomed to break in the future as new versions Microsoft.CodeAnalysis.PublicApiAnalyzers are released.

How about offering a global tool together with Microsoft.CodeAnalysis.PublicApiAnalyzers?

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

9 participants