Skip to content
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.

Fix Goto Definition with class methods #243

Merged
merged 4 commits into from
Oct 13, 2018
Merged

Fix Goto Definition with class methods #243

merged 4 commits into from
Oct 13, 2018

Conversation

MikhailArkhipov
Copy link

@MikhailArkhipov MikhailArkhipov commented Oct 11, 2018

Fixes #225
Fixes #208

  • GetDefinition(name, types) on bases does not need to push type since it calls main GetDefinition(name) which will push it. Pushing in the inner function prevents the outer from finding bases.
  • Add related tests for cases around class method navigation and various types of imports.

return result;
}
private IEnumerable<IReferenceable> GetDefinitions(string name, IEnumerable<AnalysisValue> nses)
=> nses.OfType<IReferenceableContainer>().SelectMany(c => c.GetDefinitions(name));
Copy link
Contributor

Choose a reason for hiding this comment

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

What those subType.Push() and subType.Pop() has been doing?

Copy link
Author

Choose a reason for hiding this comment

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

There is static hashset that tracks that the type is already being processed. I guess to prevent stack overflows with circular references. In this case, however, GetDefinition will add the type, otherwise, if added here, GetDefinition will return nothing since it will think type is processed up the call stack.

@MikhailArkhipov MikhailArkhipov merged commit 39a17b1 into microsoft:master Oct 13, 2018
@MikhailArkhipov MikhailArkhipov deleted the 225 branch October 17, 2018 19:45
jakebailey pushed a commit to jakebailey/python-language-server that referenced this pull request Nov 1, 2019
Fix Goto Definition with class methods
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants