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

Changes for empty reponse for GoToDefinition on PropertyAccessorSymbol #1086

Merged
merged 6 commits into from
Jan 29, 2018

Conversation

akshita31
Copy link
Contributor

@akshita31 akshita31 commented Jan 12, 2018

Fixes: dotnet/vscode-csharp#1949

Changes:

  1. Check for property accessors in GoToTypeDefinition.
  2. Test cases for the same.

Please review : @DustinCampbell @TheRealPiotrP @rchande

@@ -47,6 +47,8 @@ public GotoDefinitionService(OmniSharpWorkspace workspace, MetadataHelper metada
// go to definition for namespaces is not supported
if (symbol != null && !(symbol is INamespaceSymbol))
{
if (symbol is IMethodSymbol methodSymbol && methodSymbol.AssociatedSymbol is IPropertySymbol)
Copy link
Member

Choose a reason for hiding this comment

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

there is already the same is IMethodSymbol 2 lines lower so you may want to roll them up together and just check for IPropertySymbol there

Copy link

Choose a reason for hiding this comment

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

+1

@@ -31,6 +31,110 @@ class {|def:Foo|} {
await TestGoToSourceAsync(testFile);
}

[Fact]
public async Task DoesnotReturnOnPropertAccessorGet()
Copy link

Choose a reason for hiding this comment

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

Nit: capital Not (same below)

Copy link

@rchande rchande left a comment

Choose a reason for hiding this comment

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

Couple of things to fix. Other than that, looks good. Thanks!

@@ -47,6 +47,8 @@ public GotoDefinitionService(OmniSharpWorkspace workspace, MetadataHelper metada
// go to definition for namespaces is not supported
if (symbol != null && !(symbol is INamespaceSymbol))
{
if (symbol is IMethodSymbol methodSymbol && methodSymbol.AssociatedSymbol is IPropertySymbol)
Copy link

Choose a reason for hiding this comment

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

+1

Copy link
Contributor

@DustinCampbell DustinCampbell left a comment

Choose a reason for hiding this comment

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

LGTM

@filipw filipw merged commit 345f066 into OmniSharp:master Jan 29, 2018
@filipw
Copy link
Member

filipw commented Jan 29, 2018

merged

@akshita31 akshita31 deleted the gotodef branch January 29, 2018 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants