Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plug support of CCDB in serve-d #271

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

plug support of CCDB in serve-d #271

wants to merge 9 commits into from

Conversation

rtbo
Copy link
Contributor

@rtbo rtbo commented Nov 14, 2022

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 Pure-D/code-d#436

workspace-d/source/workspaced/com/ccdb.d Outdated Show resolved Hide resolved
workspace-d/source/workspaced/com/ccdb.d Outdated Show resolved Hide resolved
source/served/extension.d Outdated Show resolved Hide resolved
source/served/extension.d Show resolved Hide resolved
@rtbo rtbo force-pushed the ccdb branch 4 times, most recently from 2daa406 to 3bfd9c0 Compare November 19, 2022 15:38
source/served/extension.d Outdated Show resolved Hide resolved
source/served/extension.d Outdated Show resolved Hide resolved
source/served/extension.d Outdated Show resolved Hide resolved
source/served/extension.d Outdated Show resolved Hide resolved
source/served/extension.d Outdated Show resolved Hide resolved
source/served/extension.d Outdated Show resolved Hide resolved
workspace-d/source/workspaced/com/ccdb.d Outdated Show resolved Hide resolved
@rtbo
Copy link
Contributor Author

rtbo commented May 23, 2023

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
Copy link
Contributor Author

rtbo commented May 23, 2023

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

@WebFreak001
Copy link
Member

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

@rtbo
Copy link
Contributor Author

rtbo commented Jun 5, 2023

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
Copy link
Contributor Author

rtbo commented Jun 5, 2023

commit 94f0291 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 94f0291, there is no more crash.

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

rtbo and others added 8 commits May 2, 2024 20:15
two new settings are added:
 - d.ccdbPath:          user specified path to `compile_commands.json` to consider as input
 - d.enableCcdbLinting: whether to activate linting of CCDB files

Linting works by actually compiling the file using command specified in
CCDB and scanning for compiler error.
indicate to user that the diagnostics are running
 - makes `adjustArgs` lazy mutation more convenient
drive letter is now always lower case
was [0] before but was changed a while ago in another fix. We don't _really_ care yet where it is, but probably should in the future.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants