Sublime Forum

Syntax: Member function scope advice

#1

Hi guys,

I’m working on a syntax definition and I’m unclear as to which scope I should use for certain member function situations.

When declaring/defining a member function in a struct/class, should I use “variable.other.member” or “entity.name.function”?

When invoking a member function, should I use “variable.function” or “variable.other.member”?

The docs don’t seem 100% clear on this.

Cheers
Joe

0 Likes

#2

If I am not mistaken “member function” (C++) is a synonym for “method” (Java) and the documentation is clear on that. So you should use entity.name.function and variable.function.

documentation: https://www.sublimetext.com/docs/3/scope_naming.html

0 Likes

#3

Ah, you’re certainly correct about entity.name.function, this is clear given that there also exists entity.name.function.constructor and entity.name.function.destructor.

Thanks!

0 Likes