Pure-D / serve-d

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

plug support of CCDB in serve-d #271

Open rtbo opened 1 year ago

rtbo commented 1 year ago

WIP to enable CCDB in serve-d:

Works already well like this. I'd like to go further: running the command associated with the file to parse for diagnostics (instead of DScanner).

In ideal world, the import paths, versions etc. would not be a global list for the workspace, but a different set for each file. For this I need one dcd-server instance per open file right? For import paths it would not matter much, but for versions we can imagine at some point to grey out code related to unset versions.

Works with https://github.com/Pure-D/code-d/pull/436

rtbo commented 1 year ago

Hi, I thought to remember this was merged, but no ! Nevertheless I rebased on master and added linting diagnostics. Works pretty-well and is much faster than Dub's as only a single file is compiled each time . image

rtbo commented 1 year ago

Quite many commits. Don't hesitate to ask to squash.

WebFreak001 commented 1 year ago

yeah sorry about the delay, could you also auto-format your ccdb files? There seems to be mixed spaces and tabs occasionally.

rtbo commented 1 year ago

I rebased on master and squashed everything in a single commit. I also start linting CCDB on file open and not only on save. This is documented in the code-d extension PR.

rtbo commented 1 year ago

commit 94f0291ef78ecfe59b918dde0f5d9e13253702b0 is making serve-d crash. I'm not sure if it is specific to CCDB or if it would also crash with DUB, but it doesn't seem to be related with my PR.

The crash happens with big project as well as with minimal example: https://github.com/rtbo/simple-meson-d

If I rebase this PR on the commit just before 94f0291ef78ecfe59b918dde0f5d9e13253702b0, there is no more crash.

EDIT: not related to this PR and fixed by #321