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

Clang based CC, new CC interface

(1/15) > >>

Alpha:
I made an attempt to just get clang CC running with the working state of the CC plugin interface redesign.  Code attached.  (This is purely for demonstration, as it currently runs synchronously and does not cache results, so usability is low.)
Only tested under linux, some search directories are hard coded (and may need to be changed), the project directory expects to be extracted into src/plugins/, it may be necessary to disable the main CC plugin to see any results (CCManager will only query one of them because both claim to support the same files).

(For some reason, it appears clang_codeCompleteAt() is simply dumping all tokens that it knows, instead of using any sort of heuristic search/namespace resolution.  I do not know if that is error on my part, or if that is the expected output...)

Alpha:

--- Quote from: Alpha on January 11, 2014, 01:45:53 am ---(For some reason, it appears clang_codeCompleteAt() is simply dumping all tokens that it knows, instead of using any sort of heuristic search/namespace resolution.  I do not know if that is error on my part, or if that is the expected output...)

--- End quote ---
Oops.  User error on my part.  The location I passed for line/column was 0-index based, however, clang was expecting 1-index based.

(I will start a git repository for this plugin soon.)

dmoore:
Cool! I will give it a try when it makes it to git. Never understood how clang's CC works in terms of finding symbols outside of local file scope. Presumably it already knows how to find std lib stuff, but what about something like wxwidgets?

Btw, when do we get the merge of your cc branch into trunk?

Alpha:
Repository is up.

--- Code: ---git clone https://github.com/alpha0010/ClangLib.git
--- End code ---
https://github.com/alpha0010/ClangLib
Please copy the attached image into src/devel/share/codeblocks/images/codecompletion/ before testing.


--- Quote from: dmoore on January 12, 2014, 02:39:54 am ---Btw, when do we get the merge of your cc branch into trunk?

--- End quote ---
From what I can tell, it runs as stable as the trunk (I am using the cc_interface branch as my main code editor).  Part of my purpose with testing this Clang plugin is to see if any obvious changes must be made to the interface.
My thoughts are, merge the branch once the interface works without losing any features from the main CC plugin (done), tests from this Clang plugin (in progress...), and the FortranProject (not yet looked at).  If we merge before these are complete, the interface would be likely to change soon after (defeating the purpose of working in a branch).
That said, my ideal target is one/two months (which depends a lot on how easy porting the FortranProject turns out to be).


--- Quote from: dmoore on January 12, 2014, 02:39:54 am ---Never understood how clang's CC works in terms of finding symbols outside of local file scope.

--- End quote ---
The way it is set up, Clang essentially compiles the file (into memory), so all of the #includes are resolved and expanded.  Searches are done per translation unit, not per file (which does mean I had to do a bit of file trickery in this plugin).

dmoore:

--- Quote from: Alpha on January 12, 2014, 11:12:20 pm ---Repository is up.

--- Code: ---git clone https://github.com/alpha0010/ClangLib.git
--- End code ---
https://github.com/alpha0010/ClangLib

--- End quote ---

Ubuntu 13.10's clang libs seems to be missing clang-c/Index.h, so I can't build it. Anyone know of a workaround? (Installing clang from source not an option in the near term)


--- Quote ---Please copy the attached image into src/devel/share/codeblocks/images/codecompletion/ before testing.

--- End quote ---

Why don't you just deploy this file with a post build step in the project settings?


--- Quote from: Alpha on January 12, 2014, 11:12:20 pm ---That said, my ideal target is one/two months (which depends a lot on how easy porting the FortranProject turns out to be).

--- End quote ---

If my python experience is a guide, this should be relatively straightforward. Your code eliminates a lot of the fiddling with cbEditor/wxScintilla.

Has anyone contacted the fortran maintainer? (I think he has the username darmar)

Navigation

[0] Message Index

[#] Next page

Go to full version