Pure-D / serve-d

D LSP server (dlang language server protocol server)
MIT License
195 stars 48 forks source link

Support C modules via ImportC #328

Open vladimmi opened 1 year ago

vladimmi commented 1 year ago

At this point both DMD and LDC support compilation of C modules, automatically invoking external preprocessor for them if needed (DMD for some time, LDC since 1.33-beta2 version), dub also can treat C modules as part of project for building. Is it theoretically possible to have IDE support for this? I mean resolving C modules, having C functions in suggestions/goto, etc.

Reavershark commented 2 months ago

Starting off, code completion and other features use the dparse library very heavily (imported from 20+ modules). That library can't parse c files.

As I believe the D compiler frontend emits a D AST for C source code, I have some ideas:

Take them with a grain of salt, I'm very new to this project.