joshcomley
joshcomley

Reputation: 28818

Is it possible to map a shortcut key to toggle IntelliSense in Visual Studio 2010?

Not how I can elaborate more than the title...

I like to write code without intellisense, exactly how I want it to look, then use ReSharper (or whatever) to generate the classes.

IntelliSense, much as I love it, gets in the way of this process!

Upvotes: 0

Views: 387

Answers (1)

Andrei
Andrei

Reputation: 56688

Here is the solution I found. Requires some work, but still.

Actually we need to create two macros - one to disable Intellisense and one to enable it back. So what we need to do is launch Macros IDE (Tools -> Macros -> Macros IDE) and create two functions:

Sub DisableIntellisense()
    Dim p As EnvDTE.Properties = DTE.Properties("TextEditor", "AllLanguages")
    p.Item("AutoListMembers").Value = False
    p.Item("AutoListParams").Value = False
End Sub

Sub EnableIntellisense()
    Dim p As EnvDTE.Properties = DTE.Properties("TextEditor", "AllLanguages")
    p.Item("AutoListMembers").Value = True
    p.Item("AutoListParams").Value = True
End Sub

Then just save this macros and assign shortcuts for it. To do that, go to Tools -> Options -> Environment -> Keyboard. Type in the text box name of the macros (either DisableIntellisense or EnableIntellisense) - if everything was right our macros will show up in the list of commands.

I've only tried in the Visual Studio 2010 - not sure whether it was possible to interact with Options via macros in earlier versions of VS.

Upvotes: 2

Related Questions