Visual Studio 2017
I’m gonna shed light on some of the features, obstacles, tips and tricks in Visual F# Tools that haven’t been covered in the official Microsoft blog
Go to All
It’s the old “Navigate to” feature from Visual F# Power Tools (VFPT), ported to Roslyn UI. You can launch it with Ctrl+,
shortcut, as before, or with Ctrl+T
:
What’s new compared to the VFPT (VS 2015) version:
Filtering symbols by type
- You can add “f” prefix (or launch the feature with
Ctrl+F
) to search for files only:
- “t” for types:
and so on.
Fuzzy search
The search is now fuzzy, which means symbols are found even if you make typos, like this:
CamelHumps is also supported:
It works a bit differently than JetBrains’ one though.
Guide lines
Hovering over a line shows the scope this line marks:
You can turn off the guide lines for all languages in the settings dialog:
Navigation bar
It can be disabled via the settings dialog as well:
Syntax highlighting
By default only types and type parameters are highlighted. You can customize it here:
and here:
(use “User Types - Enums” to set color for discriminated unions)
Reference and load directives completion in scripts
File system paths inside #r
and #load
directives support completion:
Issues in RTW
Due to the long Visual Studio stabilization phase, VS 2017 RTW includes a rather outdated Visual F# Tools version, which contains a number of bugs and performance issues:
-
Opening any file discards the whole project check results and starts checking from scratch. It means that all the features start working on any just opened file and all opened file from the same project after a pause that’s approximately equals to current project compilation time. In short, for large projects it’s disaster.
-
Any change in any file causes full project diagnostics checking in background. It means you have one of your CPU cores constantly loaded at 100%. For example, after any change in any file in Visual F# Tools solution itself, CPU is loaded for about 20 minutes.
-
Checking referenced projects is cancelled after short period by Roslyn, which means you get a lot of unresolved types, functions and so on (shown as red squiggles) even though the whole solution is built successfully.
-
Find Usages returns duplicated results for linked files.
All these (and many other) issues has been fixed in master branch, and some new goodies has been added:
- ReSharper-like completion list ordering for members
(own properties, inherited properties, own fields, inherited fields, own methods, inherited methods,…, everything else)
- Proper glyphs for extension methods
- Completion glyphs reflect symbols accessibility