Ionide-vim icon indicating copy to clipboard operation
Ionide-vim copied to clipboard

Pipeline hints

Open KennethHoff opened this issue 1 year ago • 6 comments

Is your feature request related to a problem? Please describe. Hey, I recently started learning functional programming and F# - and by extension just recently started using this plugin. There is one thing that I would love to have, and seems to be at least partially supported already, and that's pipeline hints.

Describe the solution you'd like I want to be able to see type annotations at the end of each line like the following image. Ideally configured separately from Inlay hints so that people who want one or the other can choose.

Image

Additional context Enabling inlay hints shows something similar to what I want, but for variables instead.

Image

This seems to already be supported in the VsCode plugin, at least according to the following image from this Pull Request from 2022

Image

KennethHoff avatar Dec 17 '24 22:12 KennethHoff

This feature is implemented as a custom API fsharp/pipelineHint which is not a part of standard LSP. We would have to implement it from scratch unless Neovim provides some APIs to display arbitrary strings as if they were actual code lenses.

cannorin avatar Dec 18 '24 04:12 cannorin

I figured that this was the case since this wasn't already implemented, and since it was near-impossible to find anything about on Google - for any language. The only thing I found was the ionide vscode plugin. Maybe this concept has a name that I was unable to find any reference to.

That said though; What about the []<string> | 2 references thing? Is that not an arbitrary string? What is causing that text to appear?

KennethHoff avatar Dec 18 '24 06:12 KennethHoff

[]<string> | 2 references is a CodeLens (textDocument/codeLens), which is actually a part of standard LSP. Neovim is capable of displaying it because of that.

cannorin avatar Dec 18 '24 07:12 cannorin

Is there anything I can do to help here?

Do we need to get Microsoft to update LSP to support this (which, assuming we started today, would not happen for at least a year probably), get Neovim to support that new protocol (which would probably support it quite quickly; maybe even before it's official), and then finally for you guys to integrate with neovim?

While that's certainly the ideal outcome, it's also incredibly slow and could potentially never happen.

KennethHoff avatar Dec 18 '24 20:12 KennethHoff

I just created an LSP proposal here. Would be nice to get your opinion on the topic to help kickstart the discussion.

KennethHoff avatar Dec 20 '24 14:12 KennethHoff

I guess it's a lot faster and easier to modify FSAC to use inlay hints to also display pipeline hints. It should be able to add an option to choose which kind of hints to display (e.g. argument hints, pipeline hints, ...).

cannorin avatar Dec 23 '24 04:12 cannorin