pechorin / any-jump.vim

Jump to any definition and references 👁 IDE madness without overhead 🚀
1.08k stars 40 forks source link

Disregard matches inside multi-line comments #57

Open polaris6933 opened 4 years ago

polaris6933 commented 4 years ago

Say we have a function foo(). Somewhere in the codebase (e.g. some_file.cpp) a multi-line comment references it:

...
/**
 * This function wraps foo()
 */
Bar()
...

And when I try to find the definition for foo() I see some_file.cpp:42 * This function wraps foo() listed. Obviously this is undesired.

pechorin commented 4 years ago

Yes, and the problem is what multiline comments handling is smth what can take much longer execution time, so i think i will check and maybe i can implement optional support for this.

polaris6933 commented 4 years ago

I think a good solution (at least for me :D) would be setting a regex (preferably specific for a file type) which, if matched, causes the result to be dropped.

For example: I setup the regex ^[\t ]*\* for c++ files and any match (from my original comment that would be * This function wraps foo()) for a function definition which also matches the regex will be excluded from the list of definitions. It would be a good idea to keep them in the list of references, though.

This is purely from a user perspective, though. I have no idea how this would impact performance.