slynch8 / 10x

10x IDE/Editor
190 stars 34 forks source link

Go To Definition fails with static macro #2205

Open JPBarrick opened 11 months ago

JPBarrick commented 11 months ago

Go to the definition of a static variable works, with the static keyword.

However, if the static keyword is formed from a macro, then it doesn't work.

In this example, using Go To Definition for the variable _supportsize inside the _reservemem(...) function does not work. However, if the static keyword was used instead, then Go To Definition does work.

internal_go_to_def
slynch8 commented 3 weeks ago

I couldn't repro this

gotodefbug

JPBarrick commented 3 weeks ago

Try it with the #define _internal_ static line in an included header file.

JPBarrick commented 3 weeks ago

Video demo: https://www.dropbox.com/scl/fi/02dyj177i43au826jy3zh/Recording-2024-10-02-213727.mp4?rlkey=nc5b1kxs1gptxho8qba85gtyq&st=pqziip8s&dl=0

JPBarrick commented 3 weeks ago

This is a "unity" style build.

The main C file includes the other C files, and includes a single header file: image

JPBarrick commented 3 weeks ago

The single header file (lcars.h) includes the other header files: image

JPBarrick commented 3 weeks ago

In the example video above, I defined a name of "blah", and it could not find it.

slynch8 commented 3 weeks ago

Unity builds can be a problem. If the header isn't included included by the file the parser can't see it.

However, I think I can get it working. As a test, could you send me the name of your unity cpp file (the one that includes everything else). I think if I parse that first it might work.