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

Bug/Enhancement: Support GoTo/Declaration for function-local symbols #83

Closed
jfehrle opened this issue Jul 19, 2018 · 5 comments
Closed

Comments

@jfehrle
Copy link
Collaborator

jfehrle commented Jul 19, 2018

plugin version: 0.58.1

Description

GoTo/Declaration doesn't find function-local symbols. For example, it doesn't find "lex", which is defined on the previous line. And it should know it's a local symbol (the tooltip suggests it did a global search).

image

@jfehrle
Copy link
Collaborator Author

jfehrle commented Jul 30, 2018

I found a bug in 0.60.1 related to not distinguishing local and global symbols. In the following code, when I GoTo/Declaration on output on the last line below, the plugin incorrectly takes me to the output definition in Pervasives.mli. That's misleading, not useful behavior.

let diff_hyps o_line_idents o_map n_line_idents n_map =
  let output old_ids_uo new_ids = <omitted>

  output (List.rev o_idents) []

@jfehrle
Copy link
Collaborator Author

jfehrle commented Jul 30, 2018

Regarding the original example, it might be overwhelming to show every local symbol in the structure panel. IIRC, older versions of IntelliJ had filtering options to control whether to show variables (for Java code). On the other hand, if a local symbol is a function, I think I would want to see it in the structure panel in any case.

@giraud
Copy link
Owner

giraud commented Oct 17, 2019

fixed in 0.81

@giraud giraud closed this as completed Oct 17, 2019
@jfehrle
Copy link
Collaborator Author

jfehrle commented Oct 17, 2019

Great! That works much better, thanks!

What do you think about showing nested function definitions in the structure panel, such as output in the second example? I tend to use nested definitions often to keep my code organized.

I can put in a new request for that if you're open to that.

@giraud
Copy link
Owner

giraud commented Oct 17, 2019

@jfehrle I'm not a fan of showing every items in the structure. But please, add a feature request in github for that. I don't know maybe if I can add an icon in the structure panel to enable that feature it could be ok. I don't know how other languages do it.

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

No branches or pull requests

2 participants