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

ClangComplete plugin

(1/11) > >>

Lalaland:
V 0.1 is now complete.
Compilation Instructions
For windows you will need "Clang Binaries for Mingw32/x86" at http://llvm.org/releases/download.html plus whatever it takes to normally compile plugins for codeblocks. You will need to add clang.dll, found in the bin folder and the include folder to the build options

For linux you will need a package that provides libclang.so, the debian package is libclang1.  You will also need the headers, which can be found in the debian libclang-dev package.


The github directory can be found here:
https://github.com/Lalaland/ClangComplete

Just click on downloads and download the zip file. In the zip file is the codeblocks project file + the source files.

Usage Instructions
Create a simple project and restart codeblocks.

Load the .cbplugin plugin.
Open the simple project.
When you type 3 letters of a word, '.', '->' or '::' , or press the keys Cntr-F1 codecompletion will start

Note, this plugin will probably fail on advanced projects(at least it fails on this project), just use it on simple stuff for now


I am announcing that I am starting work on an alternate code completion plugin that uses libclang to parse the code.

With very simplistic code I am starting out with this:
http://i.imgur.com/JAs6w.png

With some images and alphabetical sorting I am here:


With correct accessibility images I am here:


No more showing of things you cannot use:


Code completion in the middle of words + local variables:




Goals for V1:

* Add support for code completion without context(no '.', '->' or '::')
* Start code completion after 3 letters
* Add alternative characters(::, ->) to start code completion
* Detect and apply compilation settings so as to find included directories and whatnot
* Run first(AKA slow) parseTranslation on opening of file
* Have the first(slow) parseTranslation run in a seperate thread
* Handle switching files well(probably a map of file names to Translation Units)
* Have icons like the current code completion
* Inherit from cbCodeComepltionPlugin
* Detect location of compiler's libstd++ headers, so I do not have to rely on clang's internal detection
* Somehow inform the user that the files are still being parsed
Now I need to move into providing auxillary features such as: calltip help, find declaration, etc

Current goals include:

* Have options including disabling images for results
* Have tooltip to help users type in parameters for functions
* Filter results by priority(going to have to use custom AutoComplete)
* Have icons show accesability(public, private, protected) as well(need libclang patch)
Bugs

* When reloading the plugin on an already open file, it will not load the file
* Any error in the proceding input will cause it to fail(and show no completion results)
NOTE: I am no longer using a patched libclang

dmoore:
Lalaland: libclang looks *VERY* powerful. That's a stunningly simple example.

A useful thing that could happen is for you to figure out a way of pulling out the common UI pieces that all CC plugins would share from the current C::B CC plugin (much like ObFuScAtEd is doing for the debugger).

dmoore:
btw, is clang fast enough to parse the buffer on the fly, as in your simple example, or do you need to get clang to pre-scan all of the files in order to get acceptable responsiveness?

oBFusCATed:
Yay, go on Lalaland, we are with you :)

ollydbg:
Great Job. I'm thinking what I can contribute :D.
It looks like you are directly link to "libclang", this is different with codelite's implementation (it call clang.exe from command line).

By the way, this topic should be moved to CodeCompletion redesign, we have a sub-forum dedicated to CC, there I have some clang stuff posted some days ago.

Navigation

[0] Message Index

[#] Next page

Go to full version