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

Allow overwriting the launch config used by Run/Debug CodeLens links #3311

Closed
escamoteur opened this issue Apr 29, 2021 · 4 comments
Closed
Labels
in debugger Relates to the debug adapter or process of launching a debug session in editor Relates to code editing or language features is enhancement
Milestone

Comments

@escamoteur
Copy link

image

@DanTup DanTup closed this as completed in 2bd8c6e May 18, 2021
@DanTup DanTup added the in debugger Relates to the debug adapter or process of launching a debug session label May 18, 2021
@DanTup DanTup added this to the v3.23.0 milestone May 18, 2021
@DanTup DanTup added the in editor Relates to code editing or language features label May 18, 2021
@DanTup
Copy link
Member

DanTup commented May 18, 2021

With these changes, you can use "Run" or "Debug" as the title for a CodeLens template (or ${debugType} which will be set depending on the matched template type) and it will hide the built-in Run/Debug CodeLens.

Here's an example that matches all templates (so will appear for main functions on both scripts and tests, and on test/group functions) that sets an env variable:

{
	"name": "env_foo2",
	"request": "launch",
	"type": "dart",
	"codeLens": {
		"for": [ // Match all templates
			"run-test",
			"run-test-file",
			"run-file",
			"debug-test",
			"debug-test-file",
			"debug-file",
		],
		"title": "${debugType}", // Sets the title to just "Run" or "Debug" depending on which template (above) it matched
	},
	"env": {
		"DANNY": "foo2", // Custom settings can be args, env, etc.
	}
},

@escamoteur
Copy link
Author

awesome!!!

DanTup added a commit to Dart-Code/Website that referenced this issue May 18, 2021
@DanTup DanTup changed the title Allow to easily overwrite the launch config that is used when tests are run in the test folder Allow overwriting the launch config used by Run/Debug CodeLens links May 26, 2021
@DanTup
Copy link
Member

DanTup commented May 26, 2021

There's a beta version with this change in if you'd like to test it out before release:

https://github.com/Dart-Code/Dart-Code/releases/tag/v3.23.0-beta.1

If anyone doesn't work as expected, please let me know!

@DanTup
Copy link
Member

DanTup commented May 26, 2021

If anyone doesn't work as expected

😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in debugger Relates to the debug adapter or process of launching a debug session in editor Relates to code editing or language features is enhancement
Projects
None yet
Development

No branches or pull requests

2 participants