Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign
Clang CC
yvesdm3000:
--- Quote from: oBFusCATed on December 10, 2016, 02:02:44 pm ---
--- Quote from: yvesdm3000 on December 10, 2016, 01:23:08 pm ---I guess you are need the compilation flags to come out of the compiler_commands.json that is generated from ninja ?
--- End quote ---
Yes, the cb project generated by cmake doesn't contain flags (it is custom makefile based project), so the cc will have very hard time gathering them.
Probably we can add a field in the project with the path of the compilation database and then the CC could use it.
We can also teach other tools and plugins to use it.
--- End quote ---
FYI next thing I'm implementing is support for this compiler_commands.json file
Yves
yvesdm3000:
I pushed a new feature to support the use of the json file. It is a project-level setting that is compiler-target specific (last tab under project settings, might be hidden by the other tabs so have to scroll to it)
Yves
BlueHazzard:
I was finally able to build the plugin under windows. Here are my steps:
1) Download LLVM from http://releases.llvm.org/3.9.1/LLVM-3.9.1-win32.exe
1.1) Install LLVM
2) Download the "reimp" tool from http://wyw.dcweb.cn/download.asp?path=&file=reimp_new.zip
2.1) Extract reimp
2.2) Build reimp with the terminal by navigating into the src subfolder and typing "mingw32-make.exe -f Makefile"
3) copy reimp.exe to INSTALL_PATH_LLVM\lib
3.1) open terminal in this folder and run "reimp libclang.lib" This should generate a liblibclang.a file.
3.2) Rename liblibclang.a to libclang.a
4) Download the source code of the cclang plugin
5) I had to make the changes to the project file according the patch i attached
6) Open the project file and set the CLANG global variable to the INSTALL_PATH_LLVM set the other global variables accordingly
7) Build target "plugin"
8) Copy the libclang.dll from INSTALL_PATH_LLVM/bin to your codeblocks directory
9) Open Codeblocks Plugins->Manage Plugins
9.1) Disable the code completition plugin
9.2) Install new and select the clanglib.cbplugin
10) Have fun
yvesdm3000:
Hi BlueHazzard,
Many thanks for this howto!
It looks like you solved the symbols-issue better than I did: I modified the llvm/clang Makefiles to output what I needed, it is certainly simpler and better with the reimp tool.
Any reason why you added a new target? Can't we just update the existing targets?
Yves
BlueHazzard:
Hi, i tested the plugin a bit and it is really nice.
Here some things i noted in this short period of testing:
1) The name of the binary is somehow unlucky... ClangLib sounds as it is something from clang but not a code completion plugin. I think ccClang or something like this would be a better name..
2) On the start of projects i get the sometimes a error message about some database could not be found? Is this only because i didn't used cclang on this project earlier?
3) I opened the codeblocks project file and it loaded successfully, but the cursor turned in a spinning circle (busy symbol) and never returned from it. I can click everywhere and it works, but the circle does not go away. And this blocks the right klick on the project tree. Also i can't close the project via menu, so it seems that the loading process is not competed?
4) I get plenty of messages like this:
--- Code: ---ClangLib: translUnitId == wxNOT_FOUND, cannot complete in file \codeblocks_sf\src\sdk\cbplugin.cpp
--- End code ---
Does this mean the parser is not complete on this file?
5) One time the plugin prevented a file to save. I was not able to save the file anymore (a error message appeared that this file could not be saved) I was not able to reproduce this in the debugger, but this seems to be a really bad bug...
thank you all for this great work!
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version