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

Support EditorBrowsable in completion for unimported types #47771

Merged
merged 11 commits into from
Sep 25, 2020

Conversation

genlu
Copy link
Member

@genlu genlu commented Sep 17, 2020

Extension method completion was fixed by #47590
This would help addressing the issue described in dotnet/roslyn-analyzers#3646

@genlu genlu added the Area-IDE label Sep 17, 2020
@genlu genlu requested a review from a team as a code owner September 17, 2020 00:32
@@ -40,6 +41,7 @@ internal AbstractTypeImportCompletionService(Workspace workspace)
bool forceCacheCreation,
CancellationToken cancellationToken)
{
var hideAdvancedmembers = currentProject.Solution.Workspace.Options.GetOption(CompletionOptions.HideAdvancedMembers, currentProject.Language);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
var hideAdvancedmembers = currentProject.Solution.Workspace.Options.GetOption(CompletionOptions.HideAdvancedMembers, currentProject.Language);
var hideAdvancedmembers = currentProject.Solution.Options.GetOption(CompletionOptions.HideAdvancedMembers, currentProject.Language);

(fix elsewhere if you used teh former).

the former is mutable and may change as the feature is running. the latter is an immutable snapshot.

Copy link
Member Author

Choose a reason for hiding this comment

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

@genlu genlu requested a review from a team September 17, 2020 22:34
@genlu
Copy link
Member Author

genlu commented Sep 18, 2020

@dotnet/roslyn-ide Can I get another review on this? Thanks

Copy link
Member

@CyrusNajmabadi CyrusNajmabadi left a comment

Choose a reason for hiding this comment

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

a few things to cleanup. please ping me for next review.

{
if (!symbol.IsModuleType())
{
return false;
}

attributes = attributes.IsDefault ? symbol.GetAttributes() : attributes;
hideModuleNameAttribute ??= compilation.HideModuleNameAttribute();

if (!hideModuleNameAttribute.HasValue)
Copy link
Member

Choose a reason for hiding this comment

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

afaiut, this will never be false. so we'll never go into this branch.

Copy link
Member Author

Choose a reason for hiding this comment

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

IsEditorBrowsable can be called with default parameter value, in which case HasValue will be false.

Copy link
Member

Choose a reason for hiding this comment

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

basically, my preference woudl be that instead of taking N extra parameters, you take an optional EBInfo struct (for caching those values). If that value is not provided, you instantiate a new one in this method.

Copy link
Member

Choose a reason for hiding this comment

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

would it be hard to take an optional EBInfo?

Copy link
Member Author

Choose a reason for hiding this comment

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

I felt it might be unnecessary given it's only called from two locations (that provides value for those optional parameters). But sure.

@genlu
Copy link
Member Author

genlu commented Sep 24, 2020

Ping @CyrusNajmabadi

@genlu
Copy link
Member Author

genlu commented Sep 24, 2020

@vatsalyaagrawal @jinujoseph Do we want this bug fix for 16.8? There's no bug/feedback for it, but it came up because of an analyzer proposal (dotnet/roslyn-analyzers#3646)

}";

var refDoc = @"
namespace Foo
Copy link
Member

Choose a reason for hiding this comment

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

References of "Foo" was removed from the code base a very long time ago in #21224

I'm not sure if you still don't want to include "Foo"s or not. But just noting.

Copy link
Member Author

Choose a reason for hiding this comment

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

@CyrusNajmabadi Is this ban on Foo still a thing? There's a ton of them in our tests still.

Copy link
Member

Choose a reason for hiding this comment

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

it's likely this will flag a review check at some point. so probably best to just not introduce new instances.

@jinujoseph
Copy link
Contributor

@genlu lets keep in master

Copy link
Member

@CyrusNajmabadi CyrusNajmabadi left a comment

Choose a reason for hiding this comment

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

thanks. that did make it a lot easier to undrstand :)

@genlu genlu merged commit f67cb8a into dotnet:master Sep 25, 2020
@ghost ghost added this to the Next milestone Sep 25, 2020
@genlu genlu deleted the EditorBrowsableUnimportedTypes branch September 25, 2020 17:52
@Cosifne Cosifne modified the milestones: Next, 16.9.P1 Oct 12, 2020
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.

5 participants