Skip to content

Conversation

@ivanbasov
Copy link
Contributor

Fixes #36187

@ivanbasov ivanbasov added Bug IDE-IntelliSense Completion, Signature Help, Quick Info labels Jun 11, 2019
@ivanbasov ivanbasov added this to the 16.2 milestone Jun 11, 2019
@ivanbasov ivanbasov requested review from a team, CyrusNajmabadi and ryzngard June 11, 2019 02:06
@ivanbasov
Copy link
Contributor Author

ivanbasov commented Jun 11, 2019

Will provide a fix for VB soon #Resolved

@ivanbasov ivanbasov changed the title Odd IntelliSense Behavior with Overloaded Methods IntelliSense not shown for overloaded methods, one with enums Jun 11, 2019
@ivanbasov
Copy link
Contributor Author

ivanbasov commented Jun 11, 2019

Will provide a fix for VB soon

Verified that no fix is required for VB. Everything works fine there.
@ryzngard , please review #Resolved

}

if (type.TypeKind != TypeKind.Enum)
foreach (var typeIterator in types)
Copy link
Contributor

@ryzngard ryzngard Jun 11, 2019

Choose a reason for hiding this comment

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

nit: foreach (var type in types) is clearer since you're not reusing the iterator variable at another point. #ByDesign

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only reason for this is there are assignments to the type variables in the body of the loop:
var type = typeIterator;
type = type.GetTypeArguments().FirstOrDefault();


In reply to: 292626186 [](ancestors = 292626186)

}
if (type.TypeKind != TypeKind.Enum)
{
type = TryGetEnumTypeInEnumInitializer(semanticModel, token, type, cancellationToken) ??
Copy link
Contributor

@ryzngard ryzngard Jun 11, 2019

Choose a reason for hiding this comment

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

I'm a little confused by this logic. If the type is not an enum, we try to get an enum? #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There can be multiple types. Some of them can be enums and some are not. The scenarios we're fixing is an overload with enum in one case and not enum in another.
We should bail out the non-enum case but provide results for the enum one. It should not depend which one was taken with FirstOrDefault.


In reply to: 292626711 [](ancestors = 292626711)

rules: s_rules.WithMatchPriority(MatchPriority.Preselect),
contextPosition: position);
var displayService = document.GetLanguageService<ISymbolDisplayService>();
var displayText = alias != null
Copy link
Contributor

@ryzngard ryzngard Jun 11, 2019

Choose a reason for hiding this comment

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

nit: alias?.Name ?? displayService.ToMinimalDisplayString(semanticModel, position, type) #WontFix

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree. Let us make this change the next time.


In reply to: 292627140 [](ancestors = 292627140)

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.

For the most part looks good to me. I'm not too familiar with this area, but the change seems straight forward with the exception of commented question.

@ivanbasov ivanbasov merged commit 2a98d64 into dotnet:master Jun 11, 2019
@ivanbasov ivanbasov deleted the enum branch June 11, 2019 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved to merge Bug IDE-IntelliSense Completion, Signature Help, Quick Info

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Odd IntelliSense Behavior with Overloaded Methods

3 participants