Improved F# hints in Visual Studio
source link: https://devblogs.microsoft.com/dotnet/improved-fsharp-hints-in-visual-studio/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Improved F# hints in Visual Studio
Petr Semkin
A few months ago, we introduced a preview of F# hints – the type and parameter name hints. Since then, we’ve fine-tuned them, added return type hints, and incorporated tooltips for all of them.
Explore the entire experience here:
Code
type Song = {
Artist: string
Title: string
}
type Playlist(songs) =
member _.Add(artist, title) =
{ Artist = artist; Title = title } :: songs
member _.Shuffle() =
Algorithms.randomize songs
Overview
In this code, you can spot type hints, return type hints, and parameter name hints.
Note that all hints now feature tooltips:
Also, we refrain from displaying hints for certain obvious scenarios:
Enabling the Hints
These hints remain in preview and off by default.
You can configure each of them separately in options (Go to Tools -> Options -> Text Editor -> Advanced):
Looking Forward and Getting Involved
In the long run, we aim to implement a hotkey for toggling hints, make them less intrusive, and include signature hints. You can find the full roadmap in this issue, and all related tickets are available using this query. Many of them are good first issues, and we warmly welcome any contributions!
Petr Semkin Software Engineer, F# Compiler & Tooling
Follow
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK