hardhat-vscode icon indicating copy to clipboard operation
hardhat-vscode copied to clipboard

Support inlay hints in solidity

Open kanej opened this issue 2 years ago • 3 comments

VSCode has added an api for enhancing source code with inlays. Typescript uses it to display inferred types for variables, among other things:

image

Are there any places in solidity development we can leverage this feature?

kanej avatar Mar 07 '22 10:03 kanej

the language status item is the preferred way to present language status reports for the active text editors, such as selected linter or notifying about a configuration problem.

There are two options: 1: inlay hints that are hh specific 2: inlay hints that are solidity specific

for the 2nd option you can see this extension: https://github.com/ConsenSys/vscode-solidity-auditor

Additional resources:

microsoft/vscode@a330b89/src/vscode-dts/vscode.d.ts#L11839

commit: https://github.com/microsoft/vscode/commit/17ed7bf82c385b9b29a458109c6d6a76049856c7 ref: https://github.com/microsoft/vscode/issues/129037 more info: code.visualstudio.com/updates/v1_65

sambacha avatar Mar 21 '22 02:03 sambacha

Another thing that we can do with inline hints, ~copied from~ inspired by intellij: when a function parameter is a literal (not a variable, not a complex expression) we can show the argument name.

alcuadrado avatar Mar 31 '22 15:03 alcuadrado

This is an example of what I mentioned

image

alcuadrado avatar Mar 31 '22 15:03 alcuadrado