Suggestions for OOP C++ 'IDE'-like functionality ?

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

Suggestions for OOP C++ 'IDE'-like functionality ?

jonetsu
Hello,

I'm a bit surprised that the 'stock' emacs I use already knows how to
'fish out' method names in .hpp files when using Ctrl-Tab for
completion (Linux).  This is neat.  Although from a quick browse of the
topic it seems that there are a certain number of enhancements that
adds much more functionality for object-oriented C++ development.  I
barely have started to read about cquery for now.  

Any suggestions for adding an 'IDE'-like capability to emacs and what
are the pros and cons for each recommendation ?  I reckon it's not only
technical as one must also feel good about using a certain set of
add-ons.

Cheers.

Reply | Threaded
Open this post in threaded view
|

Re: Suggestions for OOP C++ 'IDE'-like functionality ?

Douglas Davis
Hi,

I'll come from an LSP
(https://microsoft.github.io/language-server-protocol/) side... you
have quite a few options here for your C-family language server
provider:
- clangd (https://clangd.github.io/)
- ccls (https://github.com/MaskRay/ccls) (leverages the same clang
APIs that clangd leverages)
- and you mentioned cquery

clangd is part of the llvm project and under active development. ccls
originated from cquery and is under active development. I don't know
much about cquery. All three of these can be used as a C++ language
server.

You have two options (that I know of) for using LSPs in Emacs:
- lsp-mode (https://github.com/emacs-lsp/lsp-mode)
- Eglot (https://github.com/joaotavora/eglot)

w.r.t. a suggestion: personally I use Eglot with clangd (every few
weeks I build the llvm HEAD to get the most recent clangd). I have
zero complaints (https://ddavis.fyi/blog/eglot-cpp-ide/). I've used
lsp-mode as well, but it's been a while. Only con: When I used
lsp-mode I felt it was a bit clunky with options and extensions, where
Eglot is quite minimal, which I view as a pro. I think lsp-mode has
improved that aspect recently - I don't think you can really go wrong
with either.

Cheers,
Doug


On Fri, Jan 25, 2019 at 10:52 AM jonetsu <[hidden email]> wrote:

>
> Hello,
>
> I'm a bit surprised that the 'stock' emacs I use already knows how to
> 'fish out' method names in .hpp files when using Ctrl-Tab for
> completion (Linux).  This is neat.  Although from a quick browse of the
> topic it seems that there are a certain number of enhancements that
> adds much more functionality for object-oriented C++ development.  I
> barely have started to read about cquery for now.
>
> Any suggestions for adding an 'IDE'-like capability to emacs and what
> are the pros and cons for each recommendation ?  I reckon it's not only
> technical as one must also feel good about using a certain set of
> add-ons.
>
> Cheers.
>

Reply | Threaded
Open this post in threaded view
|

Re: Suggestions for OOP C++ 'IDE'-like functionality ?

jonetsu
On Fri, 25 Jan 2019 11:37:39 -0500
Douglas Davis <[hidden email]> wrote:

> I'll come from an LSP
> (https://microsoft.github.io/language-server-protocol/) side...

Hmmm.  I'm using Linux.  The emacs lsp-mode github points to the MS
github lsp repo.  I certainly do not have any MS compilers - does this
compile under g++ in Linux ?

Cheers.

Reply | Threaded
Open this post in threaded view
|

Re: Suggestions for OOP C++ 'IDE'-like functionality ?

Douglas Davis
Hi,

Microsoft started the definition of the "Language Server Protocol" --
it's simply a specification that anyone is free to implement (their
motivation was to make implementing IDE features standardized). All of
the projects I linked to (clangd, ccls, cquery) just implement the
features of the specification and they all support Linux.

Cheers,
Doug

On Fri, Jan 25, 2019 at 12:16 PM jonetsu <[hidden email]> wrote:

>
> On Fri, 25 Jan 2019 11:37:39 -0500
> Douglas Davis <[hidden email]> wrote:
>
> > I'll come from an LSP
> > (https://microsoft.github.io/language-server-protocol/) side...
>
> Hmmm.  I'm using Linux.  The emacs lsp-mode github points to the MS
> github lsp repo.  I certainly do not have any MS compilers - does this
> compile under g++ in Linux ?
>
> Cheers.

Reply | Threaded
Open this post in threaded view
|

Re: Suggestions for OOP C++ 'IDE'-like functionality ?

Dan Čermák
In reply to this post by jonetsu
jonetsu <[hidden email]> writes:

> On Fri, 25 Jan 2019 11:37:39 -0500
> Douglas Davis <[hidden email]> wrote:
>
>> I'll come from an LSP
>> (https://microsoft.github.io/language-server-protocol/) side...
>
> Hmmm.  I'm using Linux.  The emacs lsp-mode github points to the MS
> github lsp repo.  I certainly do not have any MS compilers - does this
> compile under g++ in Linux ?

Sure. The setup that Douglas describes works great under Linux (I am
running it too). At my previous job I had to use Windows and tried
setting LSP + cquery up on Windows with Visual Studio... 2/10 wouldn't
recommend.

signature.asc (847 bytes) Download Attachment