Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

Clang CC

<< < (31/48) > >>

yvesdm3000:

--- Quote from: teto on April 05, 2016, 03:50:58 pm ---Thansk for the fix yves, I managed to compile and load it.

I haven't looked at the code yet, do I need to do anything else apart from installing the plugin to enable it (like disabling old CC) ? Any advice on how to stresstest it ?


--- End quote ---

I always disable the old CC. I don't know at all how well they play together.

Just know that 'goto implementation' currently only works on loaded Translation Units and you can have a maximum of 5 loaded at the same time. It's a tokendatabase thing and been working to solve that for a while... It's not easy and if I would load the whole database in its current implementation for all files for my customers project, it takes a couple of gigabytes of memory, which is not acceptable.
Know that I use this plugin daily for some good coding on a pretty big project.

Also the CodeCompletion seems to be invoked a bit too often which makes it 'a little noticeable' slow on a virtual machine (not on a real PC) and sometimes CC-event gets triggered when they shouldn't, but it's not something that bothers me right now.

Class browser is not implemented at all and it looks I should try to learn from the mistakes the regular CC-plugin made. I haven't started this work at all yet.

Yves

teto:
Ok I have it working. A codeblocks reboot might be necessary or maybe it's because I disabled the regular CC-plugin but I now see the "tooltips" unlike yesterday.
My project is a custom project, hence the .cbp file does not contain the compilation flags etc... is there a way to pass on a compile_commands.json ?

I was curious to test this plugin compared to YouCompleteMe + Vim which is often not capable of finding the definition. The number of translation unit seems indeed to be the crux of the matter.
I was curious how to fix it and I stumbled on this topic that could be of interest to you:
https://github.com/Valloric/ycmd/pull/180

To sum up, clang devs think of providing a standard tool for cross TU interrogation, so maybe you should not spend too much time on this (or do it upstream :p).

yvesdm3000:

--- Quote from: teto on April 06, 2016, 03:35:08 pm ---My project is a custom project, hence the .cbp file does not contain the compilation flags etc... is there a way to pass on a compile_commands.json ?

--- End quote ---

A trick that I use is to setup the .cbp file to not use an external makefile, do a theoretical configuration with mostly the C++ language and the header search paths and then switch back to using an external makefile.

The Clang-CC plugin doesn't check if the makefile is extenal and can still query the part of the settings that are theoretically disabled.


--- Quote ---I was curious to test this plugin compared to YouCompleteMe + Vim which is often not capable of finding the definition. The number of translation unit seems indeed to be the crux of the matter.
I was curious how to fix it and I stumbled on this topic that could be of interest to you:
https://github.com/Valloric/ycmd/pull/180

To sum up, clang devs think of providing a standard tool for cross TU interrogation, so maybe you should not spend too much time on this (or do it upstream :p).

--- End quote ---
I used to use YouCompleteMe for a while but it had the same issue that I had with the initial implementation of this plugin: It blocks the UI too often preventing me to type. I will be doing essentially the same thing like they suggest: Parse every file in the project and build a token-to-file relationship. This way the plugin knows which file to parse to go find the implementation.
There is actually not a lot that Clang can do about it, in the end it needs to parse every file anyway to know what implementations it has. The intention is however to keep this indexing information to the bare minimum: Token->file and some flags that indicates if the token has a declaration, a definition or reference. This comes to a single list of token strings and 3 ints for each token-file relationship and this information will be serialized so that you can have a kick-start when initially starting up the project. (an optional 4'th int might be added later with a checksum for better fine-grained lookups.

Yves

teto:
The blocking UI problem is in general solved by neovim (a great vim fork), though I dunno for YCM in peculiar, my computer is just too fast to notice :)

I've given https://github.com/Andersbakken/rtags a try this afternoon. Out of the 3 vim plugins mentioned on the webpage, I could only make https://github.com/lyuts/vim-rtags work. I've not had the time to see how it compares with YCM but  from the description it looks promising.

yvesdm3000:
I pushed a small fix on master for when code-completion seems to be invoked when you don't want to.

Yves

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version