Skip to content

Only show first overload in a series of consecutive overload signatures #804

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

Merged
merged 2 commits into from
Oct 7, 2014

Conversation

DanielRosenwasser
Copy link
Member

...for navigateTo.

Current semantics:

  • If an overload lacks an implementation, go to the first overload.
  • If an overload has any implementation, go to the first one.
  • If there are any declarations between an implementation and any overload, this will split the series of overloads (note that this is invalid code).

overloadDeclaration = functionDeclaration;
}
break;

Copy link
Contributor

Choose a reason for hiding this comment

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

We are not walking the body of the function declaration this way, correct? If so we are missing inner functions.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, this isn't finished, I was thinking about finishing this at home but I think I need to think out some of the semantics when dealing with incorrect code.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is going to get the first overload, not the last one. I think we should get the last one.

Current semantics:
  - If an overload lacks an implementation, go to the first implementation.
  - If an overload has any implementation, go to the first one.
  - If there are any declarations between an implementation and any overload, this will split the series of overloads (note that this is invalid code).

forEachChild(sourceFile, function visit(node: Node): boolean {
forEachChild(sourceFile, function visit(node: Node): void {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would pull the visit function out

@CyrusNajmabadi
Copy link
Contributor

👍

DanielRosenwasser added a commit that referenced this pull request Oct 7, 2014
Only show first overload in a series of consecutive overload signatures
@DanielRosenwasser DanielRosenwasser merged commit 39bcb10 into master Oct 7, 2014
@DanielRosenwasser DanielRosenwasser deleted the overwhelmedByOverloads branch October 7, 2014 22:34
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
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.

5 participants