jaycetyle / vscode-gnu-global

Visual Studio Code GNU Global Extension
MIT License
33 stars 14 forks source link

gtags consume the cpu #7

Closed yinon-yishay closed 5 years ago

yinon-yishay commented 5 years ago

hi, the extension is helping me a lot. the problem is when i rebuild the tag, process name "gtags" start to run (sometime more then one) and consume a lot of cpu (about 90%). is there any fix for it? the automatic update is disable.

jaycetyle commented 5 years ago

Hi Could you tell me the GTAGS file size after the tag building process finished? This extension will call gtags to build the GTAGS file as its database. It will take several seconds if your project is too large. For example, it takes about 10 seconds to build linux kernel tags in my laptop.

yinon-yishay commented 5 years ago

Thanks for the respone.

the GTAGS file is 25.1 MiB the GRTAGS file is 64.5 MiB the GPATH file is 3.3 MiB it's take about 9 sec to generate the files. the mean problem is with the CPU each time i save a file gtags process start to run and if i save 10 file at one time it consume all my cpu.

jaycetyle commented 5 years ago

Sorry for the late reply. Have you tried to set gnuGlobal.autoUpdate to "Disabled"? Please check the the settings.json. It should be "Disabled", not "False" or something else. If you had disabled the autoUpdate but gtags still ran upon saving the code, please open the Developer Tools (in Help) to check if any error occurred. Many thanks.

yinon-yishay commented 5 years ago

it's look good and working. thanks a lot!

if you can please answer me to another question: when i do find all reference or go to definition it always show me two option. i have one definition but it show two. do you know what the reason and can help me with that?

jaycetyle commented 5 years ago

Could you please give me a example? GTAGS has some limitations in C++. It cannot tell the differences of function overloading and class member functions, so you may have multiple options in these cases.

yinon-yishay commented 5 years ago

it's not related to c++ for example i created 3 files all in c: 1) main.c - only call function foo 2)foo.h - declaration of foo 3)foo.c - definition of foo the files are attached.

foo.txt foo_h.txt main.txt

when i want to see the definition of foo in the main file it give me two definition which reference to the same place vscode_double_definition i attached a picture that shows i get two definition.

thanks again for all your help.

:

jaycetyle commented 5 years ago

Did you install another extensions like "C/C++ intellisense"? If you have more than one extensions support C/C++ code tracing, you may have more than one results got from different extensions.