When a code block is auto-generated in Visual Studio as result of a suggestion...
...we are automatically prompted to type inside a little red box, like this:
But inside that red little box intellisense doesn't work! Is there a way to fix this? It's rather annoying.
Related
I have some snippets that work nicely, but the suggestion in the info box only shows up in 'simple' context (e.g. beginning of the line, etc.), rarely when I'm nested (e.g. as function parameters). However, when I do press on "Show more results (Ctrl+J)", it does show up (and works, of course).
How do I get my snippets to always show and always show on top? Ironically, this is easily done in Visual Studio Code ("editor.snippetSuggestions": "top"), but I can't get it to work in Visual Studio 2022.
Thank you in advance!
I'm working with Visual Studio 2017, latest version (just updated yesterday).
I'm using DirectXMath which uses .inl files for some things. I understand why IntelliSense has problems with .inl files, however in my case, Visual Studio breaks IntelliSense for my files.
A simple snipped of code on which I can reproduce the problem:
#include <DirectXMath.h>
#include <DirectXCollision.h>
void f() {
DirectX::XMMATRIX projLH;
DirectX::XMMATRIX viewLH;
DirectX::BoundingFrustum fr{ projLH };
fr.Transform(fr, DirectX::XMMatrixInverse(nullptr, viewLH));
}
All works fine, VS knows about all types and functions. When I now right-click on a type or function and click Show Definition, Visual Studio shows me the source code in a overlay, which might be in a header file or in a .inl file. Sometimes (after three or four times), after I close this overlay, Visual Studio forgets about all the types. XMMATRIX, projLH, viewLH, fr and XMMatrixInverse all have red squiggly lines underneath and hovering the words says namespace DirectX has no member 'XMMATRIX' , ; expected and so on. It still compiles though.
This is quite annoying as I have to restart Visual Studio each time to fix this. Closing and reopening the file doesn't help. The next time I want to look at a declaration and the declaration happens to be in a .inl file, it breaks again. Why does IntelliSense break for my code once I opened a .inl file? Can I somehow globally disable IntelliSense for .inl files or how would I prevent this problem?
I just installed MS Visual Studio 2010, incl Visual C++, and by default at the top of each file editor window, are two pull-down lists, one with single item: "(Unknown Scope)" , and another one empty.
How to get rid of these lists altogether?
It may be "IntelliSense" - but, I disabled IntelliSense, and the lists are still there...
I also went through all the options, nothing else seems to help.
Well, I restarted Visual Studio and now they are gone. Not sure why.
The title pretty much explains the whole question. I'm using Visual Studio 2010 Premium, I like the Navigate Backward command for when I right click on something and do go to definition and then I want to go back to where I was Navigate Backward works. But I'm so used to my mouse button button doing that, I've noticed I've starting using it in Visual Studio and expecting it to go back but it doesn't. I know how to change the command to a different key press, but is there a way to make it work on a mouse button?
This seems to be a (pointless) Limitation of the C++ IDE in Visual Studio. In C# the mouse buttons work as expected, but not in C++.
There are several Addins for Visual Studio to cover this functionality, I'll point you to the one that I found in this answer:
http://www.codeproject.com/Articles/57119/Forward-Backward-Code-Navigation-with-the-Mouse-Th
This Add-In worked for me. I could also upgrade it to Visual Studio 2012 by simply changing the Version-Tag in the Addin-file to "11.0".
I moved from Visual Studio 2008 to Visual Studio 2010.
My code snippets work good in Visual Studio 2010 on the start of a line, but not when adding parameters to a methodcall. This did work in Visual Studio 2008.
So when i type this : "DoSomeMethod([nowiwantmycodennippets!]", the code snippets are not in the intellisense list.
Does anyone know if this is a setting, or just not working anymore, and if it can be fixed?
This appears to be bug. If you type your snippet name (i.e. noiwantmycodesnippets) and press ESC to dismiss the completion list (if open), then you can press Tab to insert your code snippet. So it's just a matter of the code snippets missing from the completion list.
You can use the Control+K, Control+X key chord to show the code snippets' list also. But this isn't as nice as using it through the completion list.
Are you using ReSharper? If so, Resharper Intellisense overwrites the VS default one, so that i.e. code snippets do no appear in the completions. Try turning off ReSharper Intellisense in the ReSharper Options (Environment->Intellisense->General, choose Visual Studio).
If ReSharper Intellisense is a must, you'll have to create a ReSharper "Live Template" which opens up for "code snippets" behaviour, only ReSharper is way more advanced -- see for example this one http://www.brianlow.com/index.php/2009/04/06/resharper-live-templates-for-nunit/.
On my machine I just type "public void Test(" and than ctrl+space and type the name of my snippet. Works like a charm. I've got the C# keyboard shortcuts, I think.