Skip to content

DCD does not behave as expected when compiled with LDC #665

Open

Description

@andrej-petrovic

First off, I'm not really sure where to report this. I suspect this is actually a bug in LDC, but I'm a long way from figuring out what the root cause could be. I hope this report is still useful to the DCD team, if not, I can post it over on the LDC page.

Long story short, VSCode wasn't giving me any useful auto-completions. After a while digging and manually experimenting with DCD, I found that DCD doesn't work right when it's compiled using LDC, but works fine when compiled with DMD. Specifically, it fails to find declarations and usages and prints logs along the lines of:

2022-04-19T19:18:03.151 [warning] util.d:225:getSymbolsByTokenChain Could not find declaration of istring("numFailures") from position 5041
2022-04-19T19:18:03.151 [warning] localuse.d:120:findLocalUse No or ambiguous symbol for the identifier at cursor

(where numFailures is the name of the variable at the given position of the file in question).
But when I recompiled DCD via make (which uses dmd) rather than make ldc, the auto-completion worked as expected.

The issue happens with DCD both at master (which is 2bfd3d0 as of this writing) and at tag v0.13.6.
My LDC is at version 1.29.0 and DMD at 2.099.1 — the latest releases of both.
The platform is Linux x86-64.
DMD and LDC were installed by the install.sh script found here: https://dlang.org/install.sh

I realize there are many layers here (DCD, make, DMD, LDC) but I don't really know how to narrow things down any more than I already have. It's easy enough to work around though (compile with DMD, not LDC) so if nothing else, I hope this is useful to someone.

Activity

  1. WebFreak001 commented on Apr 21, 2022

    @WebFreak001
    Member

    platform? self compiled dmd with ldc or the one from the releases page?

  2. andrej-petrovic commented on Apr 21, 2022

    @andrej-petrovic
    Author

    The platform is Linux x86-64.
    DMD and LDC were installed by the install.sh script found here: https://dlang.org/install.sh

    I'll add this information to the OP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions