Sublime Forum

Member function recognition not working for specific C++ initialiser list format

#1

Hi there!
I found that for the most recent Sublime version constructor initialiser list written down in this format:

Class::Class()
: m_member1
, m_member2
, m_member3
{};

(so with commas before member name), Sublime will fail to recognise m_member2 and m_member3 as identifiers. Therefore, it won’t highlight them, and disable options like “Jump to definition” for them. Meanwhile, when written this way:

Class::Class() :
m_member1,
m_member2,
m_member3
{};

everything works. It seems a bug to me. Could we get this sorted out?

Cheers!

0 Likes

#2

meaning build 3165?

please can you report it at https://github.com/sublimehq/Packages/issues, if there is no issue for it already

0 Likes

#3

I can not reproduce this issue on my install - the members have the exact same scopes no matter which way they are written.

Please be sure to be specific in the bug report to include exactly what is different. Also, be sure you aren’t using a third-party syntax or plugin. By default Sublime Text does not support Goto Definition for members, so it may be that the bug is in a third party package.

0 Likes

#4

Leading comma scoping:

Trailing comma scoping:

Definitely a third-party package. Either that, or something above it in the OP’s file is messing something up.

0 Likes