Weird snippet in VSCode - visual-studio-code

Does anybody know what this weird snippet is? It doesn't expand into anything.
These block-looking snippets underneath are VSCode's built-in snippets, but this first one is useless and it forces me to press the down arrow every time I want to use any loop. It doesn't have anything to do with my extensions and options and I can't get rid of it.

It is not a snippet, for is a keyword in the language you're coding. So it's just a suggestion for code completion.
In Python def is a keyword to create functions:
Check this page from document to see the explanation of the other icons.
Also if "pressing down arrow" bothers you, you have an option to set the visibility of the snippets on the top of the suggestion list:
"editor.snippetSuggestions": "top",

Related

How do I get imports to show up when I press ctrl+dot in javascript in vscode?

When writing JSX (or any typescript code really) if you have an available import that's not yet imported, you get a squiggly line under it and can press ctrl+dot on it and then automatically import the code as a "refactoring."
How can I set this up in Javascript? I've seen a screenshot of someone else's VSC where it is available underneath "more options" and so I'm pretty sure it's possible, but when I press ctrl+dot I get nothing.
Note: I'm aware I can press ctrl+space. However, I don't want to do this, for two reasons. (1) alt+space is pretty bad UX because if you press it in the middle of a word it continues to autocomplete even if you already had the full name there and so you are left with an incorrect tag (e.g. if your cursor was after the d in Keyboard for a component called KeyboardRow you are left with KeyboardRowRow) and (2) I want to rebind quick fix to alt+enter to match pycharm; and I want the same hotkey & UX in both Typescript and Javascript.
I haven't worked too much with JS, mainly with TS, but I have two extensions installed in my vscode that helped me a lot while coding in vanilla JS.
Path intellisense and Auto import
You can try if My Code Actions can be used to construct a Quick Fix for these types of PROBLEMS/squiggles

Hide VSCode snippets in suggestion list when no code is written?

In VSCode there is a setting for having snippets first in the list of suggestions ("editor.snippetSuggestions": "top",). This is great, as you might want a snippet to take precedence over other intellisense items when it matches what you've written.
However, the snippets will also be ordered at the top when you display suggestions without writing anything. I often show suggestions inside classes to see what properties/methods I have available, but in those cases I have to scroll through my entire list of snippets before the properties/methods show up. Is there any way to turn off snippet suggestions when you have not written anything?
Example image of the suggestions showing above halfway down in the suggestion list:
This is not an option as of yet, and a feature request for this funtionality has been added. https://github.com/microsoft/vscode/issues/147357
In the meantime, a workaround is to hide snippets from completions and use the explicit > Insert Snippet command instead. (Copied from the issue response)

Where can tooltips be enabled in VS Code

I use VS Code to read C# code and it always showed me tooltips (hints or whatever they're called). I could just hover the mouse cursor over the fragment of code and it told me if that's a class or method or anything else.
I'm not a programmer so that was helpful.
It also allowed me to click on the code fragment with the CTRL button pressed. It opened the related file to the code in an adjacent tab.
But then something happened and I can't do anything of the above. It makes work very uncomfortable.
Can you please give any advice as to how to return these functions?

hiding comments in matlab's editor

Is there a simple way to hide the comments while you're writing your code in matlab's editor?
I have too many comments and they really get on my nerves sometimes.
I did a little search and was surprised to find nothing on this simple issue!
Thank you in advance
One solution would be to use block comments
%{
Hello World
%}
and code folding (Preferences > Editor > Code folding)
And with right-click on the editor window you can "Fold all" then.
If you don't want to get your functions and loops folded as well, uncheck that in the preferences.
I'm afraid there is no way in the Matlab Editor to hide all commented lines in general. You will need alternative editors like Notepad++ to do that.
thewaywewalk's answer is probably what you were looking for, but for the sake of completeness: Even without block comments you can always fold the first comment in a function definition.
Before:
After:

Netbeans IDE Code Snippet Keybinding

I'm not sure if this is possible and if this is the right place to ask, but I'd like to give it a try. I'm currently trying Netbeans IDE, coming from Dreamweaver.
In Dreamweaver I can create Code Snippets and bind a key to them. So for example marking a text and pressing CTRL+B then, surrounds the text with the [strong] tag. Or I created a snippet, when I press SHIFT+CTRL+B it adds a [br /] tag at the position of the cursor.
I could not find a way to do this in Netbeans so far. Does anyone know if this is possilbe, and if, how to achieve this?
There is a Plugin available for that,
Go to Tools->plugins and try out TagMyCode
https://tagmycode.com/
I've been using it for quite some time, there is a library of public snippets and the doc is really helpful.