Sublime Forum

Some definitions are not shown

#1

I tend to use ST to code on c/c++, one very useful feature is the one to show up definitions, in my workspace i’ve added
the windows sdk includes folder, so i can access some of the windows structures/constants/functions. For some reason
some definitions are not being shown at all. Take a look to the next video, you can see how {SetPixelFormat, ChoosePixelFormat, CreateWindow} functions are showing its definitions perfectly while {wglMakeCurrent, wglCreateContext} are not. In the next screenshot you can see how those functions would look like in the already included files.

Why is this happening? I got the files including the definitions of those functions into my workspace, so… maybe is this a bug?

0 Likes

#2

Possible, but I refuse to open another screencast.com link even after I have told you about ShareX weeks ago. Okay tbf, images are okay-ish, but using flash to show videos is not.

0 Likes

#3

@FichteFoll Updated the question with a non-flash video link

0 Likes

#4

@wbond When you got a moment, could you please comment on this? Thanks

0 Likes

#5

Works for me.

Would probably have to test with the entire file.

0 Likes

#6

Ok, that’s not exactly the correct test to reproduce the exact bug. But at least shows up indexing works in the simplest case, to reproduce the bug try these ones:

mcve
wingdi.h

You should be able to get exactly this

I’ve forgotten to mention it, using build 3125 over here.

0 Likes

#7

I caramba. That is a big file. Also, this should not work:

WINGDIAPI HGLRC WINAPI wglCreateContext(HDC);
...
WINGDIAPI BOOL  WINAPI wglMakeCurrent(HDC, HGLRC);

You need to change the syntax and/or the .tmPreferences file to catch such MACRO definition.

0 Likes

#8

If you are having an issue with a default package, please post steps to reproduce at https://github.com/sublimehq/Packages/issues. The issue list allows for better todo tracking, resolution, etc.

I looked at the .h file, and it appears the preprocessor directives at lines 4754-4761 are the issue. It may be possible to resolve this, it may not. Unfortunately the C preprocessor will sometimes make it impossible to properly parse C files since it can result in impossible code where half-completed constructs are repeated within different branches of if/else constructs that are based on defines.

2 Likes

#9

Ok, I’ve moved this issue here, I thought this was a bug on sublime text’s core that’s why I assumed this would be the right place. Hopefully this can be fixed, trying to move out from Visual Studio to ST to code c++ stuff and this is one of the VS features you end up enjoying a lot :slight_smile:

0 Likes