-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jump to macro definition failed when expanding macros with length around 2400. #4306
Comments
Thanks for reporting this. The bug also repros in VS, so I've filed a bug at https://developercommunity.visualstudio.com/content/problem/752497/cc-intellisense-based-go-to-definition-fails-for-m.html . You could upvote that if you have a Microsoft account. |
Thanks. So Visual Studio and Visual Studio Code share some implementations? |
I have upvoted that VS bug report. I see this issue was removed from the 0.26.1 milestone. Kind of disappointing. Could you reveal if it will be covered in any future milestones? Thanks. @sean-mcmanus |
Yeah, our low level parsing and IntelliSense code is shared. We plan to share more later. It was removed from 0.26.1 because we don't know when the fix will get in -- it depends on when the VC++ team decides to fix. I was able to fix it for your specific repro via changing a hard-coded array size, but I don't think that is the correct fix. |
@sean-mcmanus Did this make it into 1.2.1 ? |
No. It's for 1.3.0-insiders. |
Glad it is claimed to be fixed. |
Fix is released in the 1.3.0 release version https://github.com/microsoft/vscode-cpptools/releases/tag/1.3.0 |
Type: LanguageService
Describe the bug
OS and Version:
Windows 10 Version 1709
VS Code Version:
Version: 1.38.1 (user setup)
Commit: b37e54c98e1a74ba89e03073e5a3761284e3ffb0
Date: 2019-09-11T13:35:15.005Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.16299
C/C++ Extension Version:
0.25.1
Other extensions you installed (and if the issue persists after disabling them):
A clear and concise description of what the bug is.
Open this repo in VS Code:
https://github.com/smwikipedia/macroExpansion
There are 2 files in that repo:
a.h
: defines a bunch of macrosa.c
: use the macros defined ina.h
In
a.c
file, line 7 to line 33 are some macros. See below:Jump to definition for
ztest_test_suite
on line 7 ina.c
. It will jump tostruct unit_test
ina.h
at line 1. This is incorrect. See below:So this issue seems to be related to the length of the macro expansion result. So I tried deleting single arbitrary line from
a.c
between line 8 and line 32.Repeat jump to definition for
ztest_test_suite
on line 7 ina.c
again. It will jump to#define ztest_test_suite(suite, ...)
at line 31 ina.h
. This is the correct result. See below:The final macro expansion length is about 2400. It doesn't exceed the 20000 token length limitation. However, even if I changed to
"editor.maxTokenizationLineLength": 50000
in thesettings.json
. The issue still remains.The text was updated successfully, but these errors were encountered: