sublime-cpp11 icon indicating copy to clipboard operation
sublime-cpp11 copied to clipboard

Function calls match as entities?

Open JarrettBillingsley opened this issue 10 years ago • 4 comments

This line makes it so the names of functions in function calls match as entities. It seems that the "entity" rule determines what shows up in ST's "Jump to Definition" list. This means that virtually every call in the file ends up in the JtD list. (But only in some files? I'm not sure what trips it up sometimes. I guess this is what happens when you try to parse C++ with regexes.)

I changed it to "support.function.c++" and it works much better, but I don't know much about how the syntax highlighting in ST works, so I'm not sure if this is the right thing to do. In any case, matching them as entities seems to be weird, at the very least.

JarrettBillingsley avatar Mar 12 '14 07:03 JarrettBillingsley

Sorry for the high latency :)

The reason entity.name.function is used is so the syntax highlighting can match against only the function name. For example:

            <key>name</key>
            <string>Function Call</string>
            <key>scope</key>
            <string>meta.function-call entity.name.function</string>

Do you have a minimal snippet that recreates the issue? I can't seem to reproduce it on my own code base,

noct avatar Apr 16 '14 02:04 noct

Sorry for the EVEN HIGHER latency D:

I don't know enough about how ST highlighting works to understand what that means :1

But as for a minimal snippet.. it happens with literally everything, even this:

void foo()
{
    bar();
}

Both 'foo' and 'bar' will show up in the JtD list.

JarrettBillingsley avatar Jul 12 '14 23:07 JarrettBillingsley

Weird, JtD only shows foo for me.

What version of sublime are you using? I'm currently on ST3, so I'm wondering if maybe there's a ST2 specific issue here.

noct avatar Aug 26 '14 16:08 noct

Yeah, I'm using ST2 build 2221.

JarrettBillingsley avatar Aug 26 '14 16:08 JarrettBillingsley