Plugin development
已回答
Hello
Currently i am developing device tree language plugin for CLion IDE.
Device tree language supports the use of preprocessor directives from c/c++ header files and i would like to add reference resolve to the plugin.
So my question is how should i go in resolving original preprocessor macro definition from device tree file.
What index should i use( or should i use index at all )?
请先登录再写评论。
Hi, Alexey!
If you have just a macro name, and not the original file it comes from, the easiest way would be something like
Please note that this might be (very) expensive if project symbol caches are invalidated (i.e. a commonly-used header was significantly changed), so please make sure it's cancellable and not called from UI thread.
If you know the header file (or a root .c/cpp file the header in included into) containing the macro - please let me know, there might be cheaper ways to get it in this case.
Thanks!
I have implemented suggested solution and it works well on test project.
But maybe there is a better way.
Here is example of device tree file.
It has DT_SIZE_K macro that is defined inside <mem.h> header file.
Is there a better way to resolve reference?