Skip to content

Extend range of assignment symbols to end of node #860

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

Open
wants to merge 1 commit into
base: feature/method-symbols
Choose a base branch
from

Conversation

lionel-
Copy link
Contributor

@lionel- lionel- commented Jun 27, 2025

Branched from #858

This fix is similar to #855

It makes sure the range of document symbol of assigned objects fully extends up to the end of the RHS. This allows the breadcrumbs to behave much better with the method symbols implemented in #858.

Before:

Screen.Recording.2025-06-27.at.15.37.29.mov

After:

Screen.Recording.2025-06-27.at.15.36.23.mov

@lionel- lionel- force-pushed the feature/method-symbols branch from 698f1a3 to f67b10f Compare June 30, 2025 08:42
@lionel- lionel- force-pushed the bugfix/assigned-symbol-range branch from 13ff3ff to 37c13ce Compare June 30, 2025 08:42
Copy link
Contributor

@DavisVaughan DavisVaughan left a comment

Choose a reason for hiding this comment

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

One comment about assigned vs unassigned function calls, but very nice little fix

let start = convert_point_to_position(contents, lhs.start_position());
let end = convert_point_to_position(contents, lhs.end_position());
let start = convert_point_to_position(contents, node.start_position());
let end = convert_point_to_position(contents, node.end_position());

// Now recurse into RHS
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have super deep intuition about how this should work, but from what I can tell:

  • If you have an assigned multi line function call, you get a breadcrumb
  • If you have a free floating multi line function call, you do not

Is that expected / consistent? It feels like maybe we should get a breadcrumb in both cases? Not totally sure. Probably worth comparing to other languages

Screen.Recording.2025-07-16.at.9.35.06.AM.mov

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that's expected, function calls are not emitted as document symbols. Otherwise every single function call would show up in the outline.

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.

2 participants