Pure-D / code-d

Fully featured D language extension for Visual Studio Code using Serve-D
MIT License
295 stars 47 forks source link

Wrong module names for subpackages #458

Open 0xEAB opened 1 year ago

0xEAB commented 1 year ago

Imagine the following directory structure:

- project root
|
| - dub.json
| - common
  | - myproject
    | - common
      | - path.d

And such a DUB recipe:

{
    "subPackages": [
        {
            "name": "common",
            "description": "Common library",
            "importPaths": ["common"],
            "sourcePaths": ["common"]
        }
    ]
}

code-d will generate common.myproject.common.path (instead of myproject.common.path) as name of the module.

WebFreak001 commented 1 year ago

does this happen after reloading? This should emit properly already, but I'm thinking it might occur when freshly creating subpackages, so that they aren't yet loaded as standalone projects.

0xEAB commented 1 year ago

Yes, it happens after reloading.

(Was thinking about mentioning this; as I’m aware that code-d doesn’t properly handle changes to the package recipe. Should have done so in the first place, sorry.)

0xEAB commented 1 year ago
serve-d standalone v0.8.0-beta.14
Included features: "d", "workspaces"
Built: Mon Mar 27 04:57:01 2023
with compiler LDC v2.102 on linux x86_64