Business Central 2023 wave 2 (BC23): Get inlay hints in source editor for AL method parameters and return types

Dynamics 365 Business Central

Hi, Readers.
The public preview for Dynamics 365 Business Central 2023 release wave 2 (BC23) is available. Learn more: Link.

I will continue to test and share some new features that I hope will be helpful.

Get inlay hints in source editor for AL method parameters and return types:

Business value:
Visual Studio Code supports an editor concept called inlay hints. These add additional inline information to source code to help you understand what the code does. In this release we’re adding the ability to get inlay hints for AL parameter names and return types.

https://learn.microsoft.com/en-us/dynamics365/release-plan/2023wave2/smb/dynamics365-business-central/get-inlay-hints-source-editor-al-method-parameters-return-types

Visual Studio Code supports inlay hints, which render additional information about the source inline. More information: Inlay Hints

With this release Microsoft are adding inlay hints for AL parameter names and method return types.
For exmaple,

When not enabled: we need to hover over the method name to see AL parameter names and method return types.

By default, neither of these inlay hints is shown, but with the new al.inlayhints settings you can enable each individually.

And, note that even though you have AL inlay hints enabled, you also need to enable the inlay hints feature itself in Visual Studio Code, because it’s not enabled by default. You can do that with the general “editor.inlayHintsEnabled” setting. You can decide whether you want the hints always on or off, or shown/hidden using the Ctrl+Alt keyboard shortcut.

“editor.inlayHints.enabled”:
off: Inlay hints are disabled
offUnlessPressed: Inlay hints are hidden by default and show when holding Ctrl+Alt
on: Inlay hints are enabled
onUnlessPressed: Inlay hints are showing by default and hide when holding Ctrl+Alt

And, you can even control the appearance of the inlay hints in the Visual Studio Code settings (Not mandatory).

All associated settings:

    "al.inlayhints.functionReturnTypes.enabled": true,
    "al.inlayhints.parameterNames.enabled": true,
    "editor.inlayHints.enabled": "offUnlessPressed",
    "editor.inlayHints.fontFamily": "",
    "editor.inlayHints.fontSize": 5,
    "editor.inlayHints.padding": false,

Awesome feature. Give it a try!!!😁

END

Hope this will help.

Thanks for reading.

ZHU

コメント

Copied title and URL