sublimehq / Packages

Syntax highlighting files shipped with Sublime Text and Sublime Merge
https://sublimetext.com
Other
2.95k stars 588 forks source link

[C++] Go to function append the return type of the function to the function name if separated on a different line if the return type is a custom type #3938

Open Haiderahandali opened 8 months ago

Haiderahandali commented 8 months ago

Expected behavior

The same behavior that exists for built in types (int, void)

Actual behavior

The return type is being appended to the function name in goto function as shown in the video below:

https://github.com/sublimehq/Packages/assets/53301143/fceef6bd-933b-406a-8b77-96ef519862e3

Note the issue does not happen with void and int types for example (I have not tested but probably all built in types works fine)

Steps to reproduce

define Internal as static #define Internal static define your own struct
separate the return type prefixed by Internal in its own line, while the function name in the line after it.

Haiderahandali commented 8 months ago

As discussed in the discord, this seems to be related to the macros here is a video showcasing that it does work with static and not with Internal despite it being just #define Internal static

https://github.com/sublimehq/Packages/assets/53301143/642b2996-8c60-45a8-90be-00af84932b0d

deathaxe commented 8 months ago

Syntax definition effectively doesn't currently (fully) support function declarations spanning multiple lines for historical reasons - caused by regexp patterns applying on individual lines, only.

It is possible to achive that - e.g. Java does already, but it requires major overhaul of the whole syntax definition.

Haiderahandali commented 8 months ago

@deathaxe so should I assume this is not going to be fixed within a week or two? because if I so I will just stop using it (despite it being useful for me honestly)

deathaxe commented 8 months ago

I don't think so.