简体   繁体   中英

Visual Studio 2017 enable completion after character is typed in F#

I'm developing a F# project using Visual Studio 2017. Before, I've used C# and I'm used to great autocompletion in VS that automatically pops-out and shows me a list of local variables, methods and so on when I press any character.

Unfortunately, in F# I need to force autocompletion to show by pressing ctrl + space . It shows automatically when I type someObject. , but I need to type entire phrase someObject or press ctrl + space every time I want VS to complete long variable name for me. It gets pretty annoying as I'm used to similar feature in VS Code, Sublime, and C# in VS and it really speeds up coding.

I wonder if there is any setting / plugin / hack to have such feature when using F# inside Visual Studio? Is it possible to mock ctrl + space when I type any character in code editor?

This isn't currently supported in the VS 2017 RTW tooling.

This pull request seems to add what you're looking for, and it was merged 3 days ago. There's a property dialog added (shown in the PR) to toggle this behaviour on/off.

For that reason (and plenty of other compelling reasons - the RTW tooling is stable, but it's not without its share of issues) I'd suggest you try the latest Visual F# Nightly builds.

I've just tried the latest build (as at 18 March), and this works as you describe and is enabled by default.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM