如何在VS2019中预选智能感知条目?

时间:2019-07-11 07:26:32

标签: ide intellisense visual-studio-2019

例如,我有一个名为export const fetchAccesstoken=()=>(dispatch)=>{ console.log("Calling the API to fetch the access token") const URL = 'http://ffz-sandbox-2.epdemos.com/'; Axios({ method: 'post', url: URL, data: { }, headers:{'Content-Type': 'application/x-www-form-urlencoded','Access-Control-Allow-Origin':'*', 'Cache-Control': 'no-cache' } }).then(res=>{ dispatch({type:actions.GET_ACCESSTOKEN,value:res.data}) }); }的本地StringBuilder变量。在VS2015上,键入 builder 将显示以下内容:

enter image description here

但是,在VS2019中进行相​​同操作时,它是这样的: enter image description here

我想要与2015年相同的行为的原因是,如果按Enter键或“。”。键,它将自动接受预选的条目bui。另一方面,在2019年时,按Enter /。会添加一个新行/。输出为builder +新行/。 ,与Enter上的buibuilder的行为相比。按“。”时。另外,我尝试在“选项”→“文本编辑器”→“ C#”→“智能感知”→“输入键行为”→“仅在输入完全键入的单词之后在回车上添加新行”下切换设置,但没有产生我想要的输出。

我应该如何设置或选择什么选项以实现与VS2015相同的行为?

1 个答案:

答案 0 :(得分:2)

  

确保您的计算机上已禁用切换完成模式选项。

在VS2019中,转到Edit menu=>Intellisense=>Toggle Completion Mode。单击它以更改其状态。

未选中:  enter image description here

已选中(蓝色矩形) enter image description here

然后确保您选择Only add new line on enter after end of fully typed word

我认为Toggle Completion Mode选项是造成您问题的主要原因。取消选中此选项,则Tools => Options中的Enter behavior可以正常工作。