简体   繁体   English

在F#中键入字符后,Visual Studio 2017启用完成

[英]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. 我正在使用Visual Studio 2017开发一个F#项目。之前,我使用过C#,我习惯于在VS中自动弹出很好的自动完成功能,当我按下时会显示一个局部变量,方法等的列表任何角色。

Unfortunately, in F# I need to force autocompletion to show by pressing ctrl + space . 不幸的是,在F#中我需要通过按ctrl + space强制显示自动完成。 It shows automatically when I type someObject. 当我输入someObject.时它会自动显示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. ,但我需要输入整个短语someObject或按ctrl + space每次我想要VS为我完成长变量名称。 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. 它变得非常烦人,因为我习惯于VS中的VS Code,Sublime和C#中的类似功能,它确实加快了编码速度。

I wonder if there is any setting / plugin / hack to have such feature when using F# inside Visual Studio? 我想知道在Visual Studio中使用F#时是否有任何设置/插件/黑客有这样的功能? Is it possible to mock ctrl + space when I type any character in code editor? 当我在代码编辑器中输入任何字符时,是否可以模拟ctrl + space

This isn't currently supported in the VS 2017 RTW tooling. VS 2017 RTW工具目前不支持此功能。

This pull request seems to add what you're looking for, and it was merged 3 days ago. 这个拉取请求似乎添加了你正在寻找的东西,它在3天前被合并了。 There's a property dialog added (shown in the PR) to toggle this behaviour on/off. 添加了一个属性对话框(显示在PR中)以打开/关闭此行为。

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. 出于这个原因(以及许多其他令人信服的理由 - RTW工具是稳定的,但它并非没有它的问题)我建议你尝试最新的Visual F#Nightly版本。

I've just tried the latest build (as at 18 March), and this works as you describe and is enabled by default. 我刚刚尝试了最新版本(截至3月18日),这可以按照您的描述工作,默认情况下已启用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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