Tab与vs代码中的智能感知和代码片段冲突 [英] Tab is conflicting intellisense and snippets in vs code

查看:100
本文介绍了Tab与vs代码中的智能感知和代码片段冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我想使用"for"代码段.我为编写并按两次制表符,以便它自动完成整个for循环并选择计数器,以便我可以对其进行更改.我对此进行了更改,然后按Tab键转到下一个变量(条件语句中的一个计数器< [此处]").然后的问题是我写了"arr",它会自动完成为"ANGLE_instanced_arrays"之类的东西. 我只想写"arr",然后按Tab键进入循环中的下一个变量,但是如果我按Tab键,它会自动完成.有什么解决方案吗?

I want to use a 'for' snippet for example. I write for and press tab twice so it autocompletes to the whole for loop and selects the counter so I can change it. I change that and then press tab to go to next variable(the one 'counter < [here]' in the condition statement). Then the problem is i write 'arr' and it autocompletes to something like 'ANGLE_instanced_arrays'. I want to just write 'arr' then press tab to go to next variable in the loop, BUT if I press tab it autocompletes. Any solutions?

推荐答案

我创建了一个专门回答此问题的帐户,因为这是一个令人讨厌的问题:)

I created an account specifically to answer this question because it's such an annoying problem :)

将以下内容添加到您的keybindings.json:

Add the following to your keybindings.json:

{"key": "tab", "command": "-acceptSelectedSuggestion", "when": "editorTextFocus && suggestWidgetVisible"},    
{"key": "tab", "command": "acceptSelectedSuggestion", "when": "editorTextFocus && suggestWidgetVisible && !inSnippetMode" },    

第一行禁用现有规则,第二行重新启用它,除非您处于摘要模式.

The first line disables the existing rule, the second line re-enables it unless you're in snippet mode.

这篇关于Tab与vs代码中的智能感知和代码片段冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆