-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fixed DeclarationNameCompletionProvider when used via Nuget package #36237
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Humanizer is an optional dependency of the package. It can be provided by the consumer to enable support for DeclarationNameCompletionProvider, or omitted by the consumer if that support is not needed.
src/Features/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.Features.csproj
Outdated
Show resolved
Hide resolved
I think it it is quite weird, to say the least, that a package is published in a state in which there are features and types that throw silent exceptions and don't work until you install a 3rd party package? IMHO Roslyn deliverables should be such that you can just install them from nuget and run. If a dependency on Humanizer is a blocker, perhaps That said, I hope the change to |
is there any chance of this getting merged? with the current setup the feature is silently broken.. |
Microsoft.CodeAnalysis.CSharp.Features
doesn't declareHumanizer
as a dependency - instead it usesPrivateAssets="all"
.PrivateAssets
is intended for build-time dependencies only, so the result is that the produced Nuget package doesn't contain the Humanizer.dll nor does it list it as a dependency.This is a regression that started with Roslyn 2.11.x-beta and continues into Roslyn 3.x, because it used to work.
The consequence of the missing
Humanizer
is that theDeclarationNameCompletionProvider
silently breaks when used via the Nuget package. It ends up throwing an exception about missingHumanizer
reference but that exception is swallowed.This actually broke declaration name completion in OmniSharp and shipped into the latest version of C# extension for VS Code. The current workaround is to reference Humanizer directly in the host application, but obviously the Nuget package should be fixed too.
For the record - repro steps: