Pure-D / code-d

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

Make it possible to simply run dub test #349

Open dejlek opened 3 years ago

dejlek commented 3 years ago

First of all, I am aware of the https://github.com/Pure-D/code-d/issues/279 which would be of great help, but what I am asking here is as simple as adding Test <project name> to the list of dub-auto actions (the ones you see when you press Ctrl-B). If it could be configured to run dub test on every save that would be an additional plus, but I do not mind running it manually for the time being as long as I have it in the "Ctrl-B" list. :)

WebFreak001 commented 3 years ago

this feature already exists? Can you try serve-d nightly? add user setting "d.servedReleaseChannel": "nightly" then reload window (close other vscode windows if more than 1)

dejlek commented 3 years ago

I will give it a try. I use the current release of the plugin - 0.22.0. Can't wait for new release. :)

dejlek commented 3 years ago

I use "nightly" version of serve-d now. How do I run the dub test? Ctrl-B still has only two options - run and build.

WebFreak001 commented 3 years ago

are you sure you are doing Ctrl-B? For me it only works with Ctrl-Shift-B and Ctrl-B is show/hide sidebar

Ctrl-Shift-B list: ctrl-shift-b build tasks list in vscode

dejlek commented 3 years ago

Ctrl-Shift-B, sorry! Here is what I get: image

WebFreak001 commented 3 years ago

dub test and dub rebuild are in groups "test" & "rebuild", not in "build", so vscode might be doing some filtering here.

Which vscode version do you use? Is there maybe some extra settings or commands to run tests and rebuild?

dejlek commented 3 years ago

Idk. I use VSCode v1.54.3 with latest stable code-d...

WebFreak001 commented 3 years ago

check in Ctrl-Shift-P / F1 if there are test or clean/rebuild commands maybe provided by some extension which could change this. Or if the user settings contain anything about test or rebuild

dejlek commented 3 years ago

In Ctrl-P i had the option to configure test. But I do not get it in the Ctrl-B list.

It creates the following tasks.json:

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "dub",
            "test": true,
            "compiler": "dmd",
            "archType": "x86_64",
            "buildType": "debug",
            "configuration": "application",
            "_generated": true,
            "problemMatcher": [
                "$dmd"
            ],
            "group": {
                "kind": "test",
                "isDefault": true
            },
            "label": "dub-auto: Test aws",
            "detail": "dub test --compiler=dmd -a=x86_64 -b=debug -c=application"
        }
    ]
}
dejlek commented 3 years ago

I wonder am I the only person with this problem?

WebFreak001 commented 3 years ago

whats your Ctrl-Shift-B bound to? it should be Tasks: Run Build Task

dejlek commented 3 years ago

When I press CTRL-SHIFT-B, I get two options - Build and Run the project.

vladimmi commented 3 years ago

Same for me. VS Code 1.56.0, code-d 0.22.0, Ctrl+Shift+B bound to "Tasks: Run Build Task". Only two options there: "Run" and "Build". dub test appears as an only option in "Tasks: Run Test Task" found in Ctrl+Shift+P list.

UPD: if you use hotkey or launcher to run "Tasks: Run Task" (not a "Build Task" or "Test Task" one) - you have all tasks in a single list with task groups there (dub, npm, gulp, whatever VS Code knows).

WebFreak001 commented 2 years ago

should be fixed with 0.23.x

dejlek commented 2 years ago

I have 0.23.2 installed yet I still have only "dub build" and "dub run" options when I press CTRL+SHIFT+B.

You should not close an issue without verification from at least someone who was involved in the discussion and confirmed the issue...