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 Code Lens features to be configured at a more granular level #834

Closed
andyw8 opened this issue Jul 24, 2023 · 6 comments · Fixed by Shopify/vscode-ruby-lsp#935
Closed
Assignees
Labels
good-first-issue Good for newcomers help-wanted Extra attention is needed pinned This issue or pull request is pinned and won't be marked as stale

Comments

@andyw8
Copy link
Contributor

andyw8 commented Jul 24, 2023

https://ruby-dx.slack.com/archives/C0515KVRNE4/p1690113893796309

e.g. allow the Gemfile Code Lens to be disabled independently from the test running ones.

We would still want to have a single Code Lens request, but adjusted to accept a configuration option.

A corresponding change will be needed for vscode-ruby-lsp.

We may also need to to consider how to 'migrate' users to the new configuration.

@vinistock vinistock added good-first-issue Good for newcomers help-wanted Extra attention is needed labels Jul 24, 2023
@snutij
Copy link
Contributor

snutij commented Jul 27, 2023

Hello @andyw8 👋 I can take a look at it. Any guidelines for the implementation?

@github-actions
Copy link
Contributor

This issue is being marked as stale because there was no activity in the last 2 months

@github-actions github-actions bot added the Stale label Sep 25, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 9, 2023
@simonc
Copy link

simonc commented Nov 2, 2023

Hi there! 🙂

I would have been really interested in this feature. Being able to disable the Gemfile Code Lens would be 👌

Cheers ❤️

@vinistock vinistock reopened this Nov 3, 2023
@vinistock vinistock added pinned This issue or pull request is pinned and won't be marked as stale and removed Stale labels Nov 3, 2023
@vinistock
Copy link
Member

vinistock commented Nov 28, 2023

@snutij sorry about the delay. To support this we will need to start receiving inlay hint configurations from the initialize options, similar to what we do for formatter.

We'd need to store the configuration for inlay hints in the Store class and then pass it to inlay hint here.

I think we can define the options structure to be like this

{
  inlayHint: {
    gemLinks: false,
    implicitRescue: true,
    implicitHashValue: false,
  }
}

I'd start with only the rescue hint enabled by default since it seems this feature is quite controversial. Then in the inlay hint request implementation, we'll need to use the configuration to decide which hints to push to the response.

After the server supports the new config, then we need to change the extension to surface this in VS Code.

We will need a new setting using an object type, where each property is the name of the hint with a boolean value (to match the server). Then we need to read the configured hints and send them to the server as part of the initialization options.

@snutij
Copy link
Contributor

snutij commented Dec 1, 2023

Hello @vinistock, thank you very much for the guidance 🙏

This issue was about the Codelens request, which is used to generate links to gem repositories in Gemfile. It's not the same that InlayHint, even if the need, and implementation will most likely be the same. Should the two be treated at the same time? And if not, which is the higher priority for you?

Btw, I will handle it, feel free to assign it to me 🚀

@vinistock
Copy link
Member

vinistock commented Dec 1, 2023

Oh, yeah. I'm sorry I confused the issues. Let's go with a configuration object for all requests then, so that we can use it in code lens and in inlay hint. Then we can pass the configuration object relevant to each request.

Something like

// Initialization options
{
  featureConfiguration: {
    codeLens: {
      gemfileLinks: true,
    },
    inlayHint: {
      implicitRescue: true,
      implicitHashValue: false,
    }
  }
}

In terms of priority, I would start with inlay hint since people have been asking for that more often than code lens.

I'll assign the issue to you. Thank you so much for looking into it 🙏.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue Good for newcomers help-wanted Extra attention is needed pinned This issue or pull request is pinned and won't be marked as stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants