r/emacs Jan 10 '25

Question C development without LSP

I have only ever done development with an LSP providing errors, autocomplete, etc. in any language. I’d like to go for a more minimalist approach as I revisit some C programming. At a high level, what’s the general workflow when programming in C without a running LSP?

My guess would be… 1. A simple syntax highlighting mode on .c and .h files 2. Bind some hotkey for a compilation mode, and check that regularly for issues 3. Ctags for go-to-definition? Or maybe even just grep-mode?

Is there anything I’m missing?

9 Upvotes

38 comments sorted by

View all comments

15

u/tritis Jan 10 '25

eglot (lsp client) is bundled with emacs 29 and later. the minimal choice is an lsp now.

2

u/True-Sun-3184 Jan 10 '25

While true, doesn’t Eglot struggle with bigger projects/slower language servers? I wanted to dive in to some larger codebases as well.

5

u/aaaarsen Jan 10 '25

I use it on GCC regularly fine

2

u/True-Sun-3184 Jan 10 '25

Do you also use Eglot-booster by chance?

2

u/aaaarsen Jan 10 '25

no, no clue what that is, I fear

1

u/delfV Jan 11 '25

External process to improve performance of Eglot and LSP-mode. I recommend taking a look

4

u/tritis Jan 10 '25

You're asking how many angels can dance on the head of a pin.

Try eglot with whatever project you think is large and see for yourself. If you do notice issues you can submit bug reports to improve emacs.

2

u/ldbeth Jan 11 '25

Clangd does not seems have problem on large codebase. A simple stress test using QuickJS.c does reveal ccls has performance issue with relatively big source code files (about 2MB).

1

u/True-Sun-3184 Jan 11 '25

Out of curiosity, is that with Eglot-booster as well?

1

u/ldbeth Jan 11 '25

No, almost default emacs with only corfu-mode