Find function references#516
Conversation
Implemented find references for functions. Initially, very few references were found, and this was because we were deduping the index by id. Removing this call allows us to see the entire project's references, with the notable exception of imported macros. I believe we'll need to augment the extractor with a compilation tracer if we wish to see those. The bad news is lexical takes around 12 seconds to compile, but around 3 seconds to index.
|
Do you mean we should highlight the ) ? Presently it's not highlighted. |
|
Yes, sorry, fixed the typo. |
|
Additionally, do you think that besides the definition range, the places where it’s referenced also need to include the parameters within? Wouldn’t this make it seem like there’s a bit too much noise? |
|
I think you brought this up before, and I resisted, I see your point about it being noisy, especially when passing an anonymous function as a parameter. I'd like to use the feature more before I decide if we should just highlight the name. |
The extractors were slightly wonky when extracting ranges. They would leave off the trailing paren in calls, and would capture the whole function definition. This fixes both issues. There are a couple of range issues that remain, but this is a marked improvement.
|
@scottming I did tone down the definitions to only include the definition up to the |
c2472bb to
16ea0b3
Compare
At that time, you mentioned that after the function definition includes do, it's better handled as a whole using Fragment-related AST functions. Additionally, considering that each navigation has different requirements for the range, I have no objections to having more information at the indexer stage. For example, in
Yes, it's not just with anonymous functions, the issue also arises when the argument is a list or contains a structure.
Sure, I respect your opinion. |


Find references: Functions
Implemented find references for functions.
Initially, very few references were found, and this was because we
were deduping the index by id. Removing this call allows us to see the
entire project's references, with the notable exception of imported
macros. I believe we'll need to augment the extractor with a
compilation tracer if we wish to see those. The bad news is lexical
takes around 12 seconds to compile, but around 3 seconds to index.