-
Notifications
You must be signed in to change notification settings - Fork 420
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 declaration name completion regression #1520
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.
Nice catch. Thanks!
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.
Wait, what? Roslyn has a dependency on Humanizer?
yes, for pluralization https://github.com/dotnet/roslyn/blob/master/src/Features/CSharp/Portable/Completion/CompletionProviders/DeclarationNameCompletionProvider.NameGenerator.cs#L5 |
Did you @filipw open an issue in Roslyn so that they’ll list Humanizer as a dependency? |
Yes, saw that. It was back in 2017. How come we haven’t seen any issue with missing references before? Was it because Roslyn was swallowing exceptions? |
f4b4732
to
5a6e450
Compare
it used to work. as I wrote in the PR, I'll open a Roslyn bug for this, but for now this gives an immediate fix - and resolves the regression that we suffered when we moved to Roslyn 3.x |
@filipw Yeah, sounds like they messed up the package authoring somehow. Thanks for working around/filing the bug. |
With one of the recent Roslyn betas, we have (or rather Roslyn has) regressed on declaration name completion - it doesn't work for us anymore at all.
There was no test for that, so it went unnoticed - the test is added in this PR now.
The root cause is here http://source.roslyn.io/#Microsoft.CodeAnalysis.CSharp.Features/Completion/CompletionProviders/DeclarationNameCompletionProvider.cs,70 Roslyn actually swallows all exceptions for
DeclarationNameCompletionProvider
. With the current beta, Roslyn actually throws as it can't find a reference toHumanizer
. It is a bug in Roslyn since this package is required at runtime but not listed as dependency of the Roslyn Nuget.Adding the package directly restores our old behavior and the declaration name completion works again (I tested in the editor too). I will open this as bug in Roslyn but until it's resolved, we should take in this fix.