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

Extract name recommendation logic into a separate type #64981

Merged
merged 1 commit into from
Oct 26, 2022

Conversation

genlu
Copy link
Member

@genlu genlu commented Oct 25, 2022

This just refactor the code w/o any change to the logic. I have extracted the code for declaration name recommendation into a separate type. The goal is to make name recommender an extension point so IntelliCode can provide suggestion as well, which will be in a follow up PR.

@genlu genlu requested a review from a team as a code owner October 25, 2022 22:02
@genlu genlu force-pushed the DeclNameRecommender branch from c488c89 to 4bb6117 Compare October 25, 2022 22:10
[Shared]
internal partial class DeclarationNameCompletionProvider : LSPCompletionProvider
{
private ImmutableArray<DeclarationNameRecommender> Recommenders { get; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readonly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already a readonly property

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d'oh!

description: CSharpFeaturesResources.Suggested_name.ToSymbolDisplayParts());
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this all a move? did anything hange?

Copy link
Member Author

@genlu genlu Oct 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The only change (except simply moving code around) is extracting code into methods. I intentionally excluded any real change to make review of the next PR easier.

using Microsoft.CodeAnalysis.Shared.Extensions;
using static Microsoft.CodeAnalysis.Diagnostics.Analyzers.NamingStyles.SymbolSpecification;

namespace Microsoft.CodeAnalysis.CSharp.Completion.Providers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very confused why github didn't pick upt he rename. is this substantively chnaged at all?

@genlu genlu force-pushed the DeclNameRecommender branch from 0e2060f to 19a0f5f Compare October 26, 2022 21:32
@genlu genlu enabled auto-merge October 26, 2022 22:14
@genlu genlu disabled auto-merge October 26, 2022 22:27
@genlu genlu force-pushed the DeclNameRecommender branch from 19a0f5f to c7b399f Compare October 26, 2022 22:28
Copy link
Contributor

@ryzngard ryzngard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to trust you didn't change anything

@genlu genlu force-pushed the DeclNameRecommender branch from c7b399f to 7e470ce Compare October 26, 2022 22:32
@genlu genlu enabled auto-merge October 26, 2022 22:33
@genlu genlu merged commit 392e8b5 into dotnet:main Oct 26, 2022
@ghost ghost added this to the Next milestone Oct 26, 2022
@genlu genlu deleted the DeclNameRecommender branch October 27, 2022 00:49
@allisonchou allisonchou modified the milestones: Next, 17.5 P2 Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants