Visual Studio 2017: Disable Intellisense for CodeSnippets

前端 未结 4 856
感动是毒
感动是毒 2021-01-13 03:45

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 nam

4条回答
  •  长发绾君心
    2021-01-13 04:02

    This actually works correctly in Visual Studio 2019 for classes if it is a class that is valid for the current context (i.e. Doesn't exist in a namespace not in the current class namespace or in the using statements for the file).

    Here is my example snippet

    Snippet Definition

    Snippet Use

    And here is an example where I use two different classes as the second snippet, one that is a valid class name and works to use tab to autocomplete, and one doesn't work because the class requires adding an additional namespace using statement that is currently missing from the file:

    So I see two options.

    1. Use the sucky to cancel any auto-complete logic.
    2. Ensure you have the proper using statements. You can even add using statements to your snippet using the imports declaration:

提交回复
热议问题