ruby-lsp icon indicating copy to clipboard operation
ruby-lsp copied to clipboard

Make test code lens pick up launch configurations

Open st0012 opened this issue 2 years ago • 2 comments

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.example as its name, the extension will inject its env into the generated single test commands.
  • For group tests, we use ruby_lsp.test_code_lens.group instead.

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

st0012 avatar Jun 06 '23 11:06 st0012

Seems a reasonable approach 👍

andyw8 avatar Jun 06 '23 13:06 andyw8

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.

st0012 avatar Jun 26 '23 20:06 st0012

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.

vinistock avatar Jun 18 '25 19:06 vinistock