Azure / bicep

Bicep is a declarative language for describing and deploying Azure resources
MIT License
3.25k stars 753 forks source link

Feature Request: Inlay Hints for reference type #15048

Open JustinGrote opened 1 month ago

JustinGrote commented 1 month ago

Is your feature request related to a problem? Please describe. The language server should support inlay hints and emit inlay hints that indicate for a given reference, whether it comes from a param, var, or resource.

For example:

param Test = 'ok'

var mytest = Test

should become when inlay hints are enabled:

param Test = 'ok'

var mytest = param:Test

Where param will of course be rendered with alternate smaller gray font or whatnot by the editor.

Further, functions should emit inlay hints for their parameters where available.

majastrz commented 1 month ago

@JustinGrote This is a great feature to have.

One challenge we will run into is that our language server currently uses the OmniSharp libary to implement the LSP protocol and the version we're using does not support inlay hints. (We are on the latest version.) Adding the support to OmniSharp will be a prerequisite for this.

JustinGrote commented 1 month ago

@majastrz um, it exists... https://github.com/OmniSharp/csharp-language-server-protocol/blob/2359f0104ff079f51c71a7eb7ac634fb525bcb35/src/Protocol/Features/Document/InlayHintFeature.cs#L24

StephenWeatherford commented 1 month ago

Have wanted to add something like this but never have time. The VSCode ARM Tools extension has some similar functionality (not with inlay hints, they didn't exist then).

majastrz commented 1 month ago

@JustinGrote This is a great feature to have.

One challenge we will run into is that our language server currently uses the OmniSharp libary to implement the LSP protocol and the version we're using does not support inlay hints. (We are on the latest version.) Adding the support to OmniSharp will be a prerequisite for this.

Yes, you are right. The types for inlay hints are available in the version you are using. Perhaps it wasn't included in the release notes? But good news regardless.