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-eval plugin using code actions in addition to a code lens #4155

Closed
noinia opened this issue Mar 28, 2024 · 1 comment
Closed

Allow code-eval plugin using code actions in addition to a code lens #4155

noinia opened this issue Mar 28, 2024 · 1 comment
Labels

Comments

@noinia
Copy link

noinia commented Mar 28, 2024

Is your enhancement request related to a problem? Please describe.

I'm using eglot in emacs as my lsp-client. However, eglot does not support code-lenses, just code actions. That means it is currently impossible to use e.g. the eval plugin to evaluate code snippets.

Describe the solution you'd like

I would like to be able to use the eval as a code action; e.g. when the cursor is over foo/or maybe just when 'foo 5' is selected in a piece of code like:

-- >>> foo 5 
--

I want hls to give my 'evaluate foo 5' as a code action (rather than/instead of) a code lens.

Describe alternatives you've considered

The alternative would be to implement and integrate code-lenses into eglot / emacs. However,

  1. since this pr has been open for quite a while, that does not really seem to move all that much, but maybe more importantly
  2. Even with lsp-mode I find the lens-actions overlays to show e.g. "evaluate" and/or type lenses fairly disruptive; (as e.g. it requires clicking on it), I think having eval be available as a code-action will make for much better integration into e.g. emacs/eglot (and potentially other mostly keyboard oriented editors).

Additional context

Since this functionality seems to already mostly exist in form of a code-lens, I'm optimistically hoping it would not be too much work to add this. I'd be happy to help implement it; but I simply wanted to raise an issue first to see if there are fundamental reasons why providing eval as a code-action (in addition to) a code-lens is undesirable.

@michaelpj
Copy link
Collaborator

Duplicate of #496?

Generally I do agree it would be nice if all code lenses were also available as code actions.

@michaelpj michaelpj closed this as not planned Won't fix, can't repro, duplicate, stale Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants