serve-d icon indicating copy to clipboard operation
serve-d copied to clipboard

plug support of CCDB in serve-d

Open rtbo opened this issue 2 years ago • 5 comments

WIP to enable CCDB in serve-d:

  • new config key: d.ccdbPath for the path to compile_commands.json
  • lazy load ccdb component if d.ccdbPath is set (in onConfigChange event)

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 avatar Nov 14 '22 00:11 rtbo

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 avatar May 23 '23 11:05 rtbo

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

rtbo avatar May 23 '23 11:05 rtbo

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

WebFreak001 avatar May 23 '23 12:05 WebFreak001

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 avatar Jun 05 '23 20:06 rtbo

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

rtbo avatar Jun 05 '23 21:06 rtbo