Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2017: Disable Intellisense for CodeSnippets

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"

snippedFeature on tab

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

like image 580
user2959547 Avatar asked Sep 05 '17 11:09

user2959547


2 Answers

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. Tools/Options/TextEditor/C#/IntelliSense 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.

like image 75
zORg Alex Avatar answered Nov 15 '22 07:11

zORg Alex


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. enter image description here

like image 22
James Earnan Villaverde Avatar answered Nov 15 '22 06:11

James Earnan Villaverde