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

Make it possible to simply run dub test

Open dejlek opened this issue 4 years ago • 15 comments

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. :)

dejlek avatar Mar 20 '21 12:03 dejlek

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)

WebFreak001 avatar Mar 20 '21 18:03 WebFreak001

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

dejlek avatar Mar 23 '21 16:03 dejlek

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.

dejlek avatar Mar 23 '21 16:03 dejlek

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

WebFreak001 avatar Mar 23 '21 17:03 WebFreak001

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

dejlek avatar Mar 23 '21 17:03 dejlek

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?

WebFreak001 avatar Mar 23 '21 17:03 WebFreak001

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

dejlek avatar Mar 23 '21 18:03 dejlek

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

WebFreak001 avatar Mar 23 '21 18:03 WebFreak001

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 avatar Mar 23 '21 18:03 dejlek

I wonder am I the only person with this problem?

dejlek avatar Mar 31 '21 16:03 dejlek

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

WebFreak001 avatar Mar 31 '21 16:03 WebFreak001

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

dejlek avatar Apr 03 '21 16:04 dejlek

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).

vladimmi avatar May 17 '21 18:05 vladimmi

should be fixed with 0.23.x

WebFreak001 avatar Dec 03 '21 11:12 WebFreak001

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...

dejlek avatar Jul 07 '22 11:07 dejlek