Skip to content

Drop support for variable substition for program and runtime in package.json #31675

Closed

Description

Stop supporting variable substitution (e.g. ${workspaceRoot}) inside the package.json runtime and program fields.

Affected are exactly these two attributes in the debuggers contribution:
2017-08-07_20-25-31

We have never marketed this feature and now it is providing some debt when introducing multi root workspaces (as the package.json can not specify against which root to resolve the variables against)

Activity

  1. added
    debt
    debug
    on Jul 28, 2017
  2. added a commit that references this issue on Aug 3, 2017
    064efc9
  3. WebFreak001 commented on Aug 7, 2017

    @WebFreak001

    Did you mean the debug launch.json or the actual extension package.json? If it's the launch.json, is "cwd": "${workspaceRoot}" still supported? There isn't really a solution to change the cwd to if you want to commit the debug file to a project if that variable gets removed from cwd.

  4. weinand commented on Aug 7, 2017

    @weinand
    Contributor

    Jan Jurzitza (@WebFreak001) as the titles says, I only mean variable substitution in the "package.json" of a debugger extension. So this planned feature drop only affects debug extension authors, not end users.

  5. DonJayamanne commented on Aug 7, 2017

    @DonJayamanne
    Contributor

    Phew.
    Thanks for the clarification Andre Weinand (@weinand) . Almost started panicking here.

  6. DanTup commented on Aug 7, 2017

    @DanTup
    Contributor

    Andre Weinand (@weinand) I'm slightly confused by what's being dropped. I do have some instances of ${workspaceRoot} in my packages.json however I believe that all of them are just written into the launch.json literally, so no substitution is done.

    Two of them (configurationAttributes/launch/properties/program/default here and initialConfigurations/program here) appear as the string ${workspaceRoot} and the other (configurationSnippets/bodyprogram here) is written as "^\"\\${workspaceRoot}/bin/main.dart\"".

    Would I be right in assuming that none of this would be affected, but after the change maybe the last one would not need the escaping?

    Thanks!

  7. weinand commented on Aug 7, 2017

    @weinand
    Contributor

    Danny Tuppeny (@DanTup) yes, variable substitution in the package.json does not affect your contributions (and you can verify this easily because the generated launch.json should contain the ${workspaceRoot} variable literally).
    The escaping for the snippets is needed because of the snippet syntax, not to prevent the variable substitution. Variable substitution only occurs for the program and runtime attributes of a debuggers contribution:

    2017-08-07_20-25-31

  8. DanTup commented on Aug 7, 2017

    @DanTup
    Contributor

    Andre Weinand (@weinand) Gotcha! Thanks!

  9. locked and limited conversation to collaborators on Nov 17, 2017
  10. added a commit that references this issue on Sep 6, 2026
    191c413
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

debtdebug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions