문제

Is it possible to make a add-in for IntelliSense so that you can for example type if then press enter or tab then IntelliSense "imports" that snippet?

If not is there any way, except for the CTRL+K, X way?

Thanks

도움이 되었습니까?

해결책

If you are attempting to add statement completion to a new language in Visual Studio, Microsoft has posted the following walkthrough to help with the process.

Walkthrough: Displaying Statement Completion

다른 팁

I've had great success making my own snippets with SnippetEditor

I believe what you are looking for is the ability to add custom snippets. In this StackOverflow answer I give an example of creating and installing a snippet.

The specific item you are looking for regarding IntelliSense is the Shortcut element, which appears as the following line in the linked answer.

<Shortcut>tan</Shortcut>

Note that you probably will not be able to reuse the shortcut already used by another snippet. By default, Visual Studio 2010 installs a snippet if.snippet in the following location:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC#\Snippets\1033\Visual C#

If you want to replace the snippet used for the shortcut if, you'll need to either edit this file, or remove it to use one installed in your user profile.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top