-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
C++: GoToDefinition/Declaration does not work for macros #758
Comments
I've managed to get it working by adding an extra |
I'm worried about the impact of that option on completion lookup speed. I'm going to have to run some benchmarks with and without the option. |
@kubus-puchatek Could you offser more details? Thank you :) |
@jlyu Here's a diff of my changes:
|
I'm up to my neck in work, so if you could run some benchmarks for before/after, that would be great. You should look into the LIBCLANG_TIMING env var (when set, you'll get timing data from libclang on ycmd stdout). |
While debugging an ultimately unrelated problem I ran the numbers. Throwing them away would be a pity. Opening TranslationUnit.cpp, going to line 256 column 18 and calling ":YcmCompleter DoToDefinition". unchanged version No interpretation. Repeated the run -- all numbers, text stripped away Laptop with SSD |
patch works nicely |
Hum, The patch works so well that I've the feeling it is actually faster than before... |
Maybe we could at least have a config option to turn it on/off? We would be able to enable it if we mainly work with code that is full of macros (like C). |
This is a compile time flag for a cpp library. Its not easy to change during runtime? I would argue that having a better completion is "always" worth a speed-expense |
Given the following translation unit:
Positioning the cursor on the second
FOO
token and executing:YcmCompleter GoToDefinitionElseDeclaration
gives the following error:RuntimeError: Can't jump to definition or declaration.
. This works in clang_complete.Server logs:
The text was updated successfully, but these errors were encountered: