implementation of code completion and source code browsing for an IDE

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

implementation of code completion and source code browsing for an IDE

Jared Low
We are using Clang as our compiler, and I'm implementing code completion and source code browsing, including:
  • goto definition
  • find all references to functions, variables, data types, and macros in project
  • call graphs
  • list of functions, types, macros, and variables in project and each source file
  • list of included files in each source file

I'm new to Clang, but in looking at the libraries, it seems I could use the clangIndex library for the source code browsing and the clangFrontend library for the code completion. The clangIndex library already has things that I need like the declReferenceMap and the callGraph.

I also found libclang, which seems to provide a lot of the basic functionality that I need as well.

My question is whether I should use libclang or the clangIndex and clangFrontend libraries?

Thanks for any help.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: implementation of code completion and source code browsing for an IDE

Douglas Gregor

On Mar 25, 2011, at 12:53 AM, Jared Low wrote:

We are using Clang as our compiler, and I'm implementing code completion and source code browsing, including:
  • goto definition
  • find all references to functions, variables, data types, and macros in project
  • call graphs
  • list of functions, types, macros, and variables in project and each source file
  • list of included files in each source file

I'm new to Clang, but in looking at the libraries, it seems I could use the clangIndex library for the source code browsing and the clangFrontend library for the code completion. The clangIndex library already has things that I need like the declReferenceMap and the callGraph.

I also found libclang, which seems to provide a lot of the basic functionality that I need as well.

My question is whether I should use libclang or the clangIndex and clangFrontend libraries?

Please use libclang, which is designed for this kind of IDE integration. If it doesn't provide a feature that you want, let's work on extending libclang with that functionality.

- Doug

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: implementation of code completion and source code browsing for an IDE

Stefan Seefeld-4
In reply to this post by Jared Low
On 2011-03-24 19:53, Jared Low wrote:

> We are using Clang as our compiler, and I'm implementing code
> completion and source code browsing, including:
>
>     * goto definition
>     * find all references to functions, variables, data types, and
>       macros in project
>     * call graphs
>     * list of functions, types, macros, and variables in project and
>       each source file
>     * list of included files in each source file
>

Jared,

I'v been working on such a project, and most of the features from your
list above are supported. Search the list archives for "Synopsis".
Here is a recent cross-reference for Clang itself:  
http://synopsis.fresco.org/clang/.

I use libclang to navigate the AST of a translation unit, and translate
it into a similar structure in Python, where I can manipulate it in
different ways, before generating output in various formats.

The project itself lives here: http://synopsis.fresco.org/

Regards,
         Stefan

--

       ...ich hab' noch einen Koffer in Berlin...

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev