Make test code lens pick up launch configurations
With Shopify/vscode-ruby-lsp#631, users can now specify env var in their launch configurations. And we should explore a way to let our code lens actions pick up those configurations as well.
I'm thinking something like:
- If a launch action has
ruby_lsp.test_code_lens.exampleas its name, the extension will inject itsenvinto the generated single test commands. - For group tests, we use
ruby_lsp.test_code_lens.groupinstead.
(The example and group concept is borrowed from https://github.com/Shopify/ruby-lsp/pull/734)
It feels pretty hacky so we should also check if and how other LSP servers resolve this.
Seems a reasonable approach 👍
It looks like vscode-java-test (maintained by MS) provides specific configuration (java.test.config) for custom code lens config (link), and then render code lens based on the configurations.
Dart's code lens also allows users to customise custom code lens items and render them dynamically.
We should prioritise such design because running debug code lens in apps that use Spring (e.g. Core) requires DISABLE_SPRING=1 to properly trigger breakpoints.
I'll close for now this since our decision with the new explorer implementation was to have limited support for tests that depend on external arguments.