Visual Studio 2017: Disable Intellisense for CodeSnippets

ぐ巨炮叔叔 提交于 2019-12-30 09:37:14

问题


I'm using Visual Studio 2017 Enterprise, Version 15.3.3

I looks like IntelliSense has some new features for code completion. On of this feature is, that a field name is automatically suggested when a type is written.

SpacePosition s.. // starting with s, Intellisense suggest "space", "position" and "spacePosition"

I like this feature in general but not for code snippets. Using a code snipped I have the problem, that the name of a literal is automatically replaced by IntelliSense after pressing tab (which is used for navigate to the next literal).

In my example I want to name the property "other" and then jump the the next literal inside the snippet. But because of IntelliSense, the property name is replaced by "spacePosition".

Is there any way to disable the IntelliSense feature inside code snippets?

I found a solution for the same problem in Visual Studio Code: stackoverflow article but not for Visual Studio


回答1:


Disable the name suggestions in Tools/Options/TextEditor/C#/IntelliSense. That's what is causing this nonsense. Seems MS realized later that they flipped coders up by adding that feature that changes old behaviour greatly without giving them a way to disable it. Now there is such a checkbox. I nearly uninstalled this studio because of this lol. Not sure, may be it's a good feature, but i'm too used to Tab code snippets around, that I'm better without it.




回答2:


How to: Manage Code Snippets

To access the Code Snippets Manager

1.) On the Tools menu, click Code Snippets Manager. Shortcut Ctrl+K,Ctrl+B

How to: Change snippet behavior

To change snippet behavior.

1.) Go to Tools > Options > Text Editor > IntelliSense > Snippet Behavior

2.) See images.




回答3:


Now there has no such option to disable this intellisense feature inside code snippets, but you can try to click 'Esc' key after type 'other', then click 'Tab' key to jump to next literal, please check the following:



来源:https://stackoverflow.com/questions/46053436/visual-studio-2017-disable-intellisense-for-codesnippets

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!