Skip to content

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

Closed

Description

@escamoteur

image

Activity

  1. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on Apr 29, 2021
  2. added
    in debuggingRelates to the debug adapter or process of running debug sessions
    on May 18, 2021
  3. added this to the v3.23.0 milestone on May 18, 2021
  4. added
    in editorRelates to code editing or language features
    on May 18, 2021
  5. DanTup commented on May 18, 2021

    @DanTup
    Member

    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.
    	}
    },
  6. escamoteur commented on May 18, 2021

    @escamoteur
    Author

    awesome!!!

  7. 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[/+] on May 26, 2021
  8. DanTup commented on May 26, 2021

    @DanTup
    Member

    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!

  9. DanTup commented on May 26, 2021

    @DanTup
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    in debuggingRelates to the debug adapter or process of running debug sessionsin editorRelates to code editing or language featuresis enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions