visual studio editor expand collapse widgets are gone - ide

The plus / minus signs are gone to expand / collapse regions. The vertical lines to indicate regions are gone too.
The regions are collapsing and all the commands under edit, outlining work fine.
It's just I have to double click on the collapsed region to expand and there's no way to collapse a region with the mouse. Only the shortcut keys (ctrl m, m) or the menu will do it.
I swear it was right this morning but I did something to mess it up. I can't find any option in tools to fix it either.
UPDATE
Now, some files are doing this and other files (both opened at same time) are not doing it. If anyone can explain, I'm all ears.

Press ctrl+, (control plus semicolon) to open the settings. And type Folding Strategy in the setting's search bar. It is set to auto by default. You can set it to always for the controls to be visible at all times, otherwise, it shows only on mouse over.

This same thing happens to me multiple times a day using VS.NET 2015 Pro version 14.0.24720.00 Update 1. Restarting the IDE always restores normal function for a while but the problem always returns, seemingly at random.
UPDATE:
I tried changing the theme from dark to blue and it restored the outlining. I then changed back to dark from blue and the outlining continued to work normally. Still a pain but definitely a lot faster than restarting the IDE.

It happened with me also. One file was just fine and other file (js) was not. I searched it a lot.
Try selecting a method/if check etc and press ctrl+M+H which is short cut for right click outlining > Hide Selection.
You can do it on the whole document as well.
This might be helpful when working on a file which has too much code in it and you are going through different functions again and again. It is painful with scrolling mouse for so long.
You can use short cut for for moving at the start of the method or at the end of the method with the following :
select parenthesis { start or end } and press ctrl+}
Hope this helps.

It works again.
I closed all windows and reopened my code file.
Now it shows the plus minus glyphs again.

I know this is an old post, but I wanted to share a quick solution. if you right click and hover over 'Outlining' and then click 'Collapse to Definition', the widget comes back. Then just press [ctrl] + z to undo and continue where you left off.

With Golang, if the code has some syntactic mistakes that would prevent it from compiling, the language server cannot decide which parts of the code are collapsible, and which not.
Therefore the solution is either switching to the Folding Strategy in VSCode settings to indentation folding, or fixing the syntactic errors.

Simple solution : CTRL + M + O, then CTRL + Z
Thanks to SparrowEatsHawk

Related

Intellij 2016.2.5 Darcula 16: perceptible highlight of currently active tab

I find it extremely difficult to spot the currently selected tab in Intellij, if using the Darcula theme. I've looked for a workaround and I was not able to find any solution besides disabling the "Use in Editor Tabs" checkbox in Settings->Appearance&Behavior->FileColors.
This issue has been reported by several other users (e.g. this question), but I can't seem to solve it for the current version of Intellij/Darcula.
Thanks
One possible fix is to use the single tab model, where you set the maximum open tabs to 1. You can use open-recent, open class, and the project explorer to navigate around your codebase. I switched to this model after seeing a colleague working this way last year and I'm enjoying it. It took me a few days to get used to it, but having the tool enforce the single tab approach helps because you are basically forced to work this way.
You can try Material Theme plugin for intellij. It has a dark theme like Darcula and it would underline and highlight your current tab.
And if you think long term perspective, actually Engineer Dollery is correct. When you get more and more experience with intellij, you also feel that working with multiple tabs is really a time waste. Single tab mode is much efficient.
Because intellij provides plenty of navigation tools like Ctrl + Shift + N , Ctrl + tab , Ctrl + E , Ctrl + Shift + E , you really don't need tabs. These shortcut keys make sure your finger tips remain on keyboard and save the time you have to deal with switching to touch pad/mouse and again to keyboard when you try to switch the tabs in multiple tabs mode. If you count this time saving for a week/month, actually its a huge amount. :))

Line-Comment shortcut on german keyboards

What is the equivalent of CTRL + SLASH on german keyboards?
I know that US-Layouts got that / where the german _ is, since I used an US-Layout for some time. But CTRL + _ just collapses a method.
Just use the slash (Ctrl + /) on the numpad.
I found a solution for using the desired shortcut on Intellij Idea.
You just need to:
- click Ctrl+Alt+S to open the settings dialog box,
- choose "Keymap" from the left menu
- then search for keyword "comment".
- right click on "Comment with Block comment" and select add Keyboar Shortcuts.
- Type the shortcut you want to use and click ok.
For more details : https://www.jetbrains.com/help/idea/2016.3/configuring-keyboard-shortcuts.html
I just changed Ctrl + Slash and Ctrl + Shift + Slash to Ctrl + 7 and Ctrl + Shift + 7.
Works as expected, as they are the same key on german keyboards.
Problem is Ctrl + Shift + 7 is used for bookmarking a line, so I have to override this shortcut.
As of today it is still an unresolved IDEA issue, see this
https://youtrack.jetbrains.com/issue/IDEA-16116.
Defining a custom keymap seems to be the best solution.
A little late to the party, but maybe it helps someone...
I'm using Ubuntu 16.04 with the gnome desktop.
I frequently switch between the german and english keyboard layout.
In order to be able to use IntelliJ shortcuts with the english layout I had to change the order of the layouts in my system settings:
(gnome desktop) > settings > keyboard > Input source (top right corner)
There you find all configured input sources. I moved "english" to the top.
Now I can use all shortcuts based on the english layout, even when I switch to german. This means e.g. Ctrl + _ with the german or Ctrl + / with english layout would be line-comment in IntelliJ.
Not really an answer but I found this while googling and unfortunately had to add a custom keymap, too.
I now have it on CMD + ß. The combination is not used (which makes sense due to its QWERTZ relation). Works for me.
I just discovered that STRG(CTRL) + # works for my QWERTZ-Keyboard.
Hope it helps somebody!
It's been almost 4.5 years and I just want to share with you guys, which route I took because of only this issue (more or less). Sorry that this is not an answer in the proper stackoverflow manner.
I switched my keyboard setting to "US - International" and only use this one for everything I do nowadays. You can have the umlauts (by pressing Shift + ä and then your desired letter) on windows and macos. An all the "special keys" feel so much more natural! While you have to do finger-splits for certain characters, they use AT MAX the shift key on US layouts. Feels so much nicer to write and code like that!
I know, this is probably not what you are going to do, but I can tell you, that I find more and more people who did that and not a single one of them regretted that. Obviously that means, that you should be able to type blindly. :) At least, most keyboard I use, don't have the US layout on it. I adapted to it pretty fast though.
So basically, having the umlauts takes a tiny little bit more effort, but this is really worth it, because everything else makes so much sense on the US layout and you will get all the keymaps as they were intended to be used. Not those crappy "translations" that sometimes don't make sense, like this annoying line-comment thingy here.
Update 2021:
Compare how you write those characters on a US layout compared to whichever layout you are using. There are dramatically less keys involved in using those chars and I can write them faster and also with less wear and tear on my fingers.
;
:
/
`
'
#
<>
[]
{}
I also struggle with this shortcut and could'nt find the right combination.
The only solution i found is to change to English keybord layout using Alt+Shift and then use Strg+Underscore for commenting and back to german layout Alt+Shift.
This helps for the moment. Hope for a better solution.
I solved this by changing the shortcut. You can do this the following way:
In Android Studio in the top menu, click on Android
Studio->Preferences...
A new window pops up, in the side menu of it select Keymap. Now
you see a list. Click on Main menu -> Code -> Comment with
Line Comment (doubleclick) -> add keyboard shortcut.
A small window pops up. You can now simply press the shortcut you
prefer and click ok.
Don't forget to save your changes by clicking OK or Apply.
The configured shortcut should work immediately.
Copying over a solution I found in one of the comments in Jetbrain's bug tracker (see https://youtrack.jetbrains.com/issue/JBR-216#focus=Comments-27-4838035.0-0 )
[...]
I found the plugin "Keyboard Nationalizer". Install the Plugin, restart IntelliJ and execute the Action "Generate National Keymap" - that's it.
After generating a German layout, the shortcuts can be used again
If you are on macOS (MacBook, ...) and have a German keyboard you can make the command + / keymap work like this:
Step 1 - macOS settings
Disable the "Hilfemenü anzeigen" ("Open the Help menu") shortcut in the keyboard settings of macOS:
Step 2 - IDEA settings
In the keymap preferences of IntelliJ IDEA (or Android Studio) add the keymap shift + command + 7 for "Comment with Line Comment". Note: I used the "macOS" keymap settings as the basis, and adding a keymap will create your personal copy of the settings.
Now it should work the same way as in Visual Studio Code for example.
In my current version of IDEA v.20221.1.4 there is an option "Use national layouts for shortcuts (require restart)". Activate it, nothing changed.
Then I check the documents of IDEA, it says you need to install the "Keymap Nationalized" plugin to use it. Deatails about this plugin can be found here: https://plugins.jetbrains.com/plugin/14625-keymap-nationalizer
After install this plugin in IDEA. Double click "Shift" button in IDEA, the "search every" windows will be opened. Find the setting for Keymap Nationalized plugin. Now you can choose the language for the keymap. You will see new keymaps were added, for example there is a new keymap for the Comment with line added.
For MacBook Pro & Air, command + shift + 7 works fine in Visual Studio Code.
If you have a numpad, try using command + /(from the numpad). It worked for me.

Cycle through autocomplete suggestions without arrows

I'm really impressed with the autocomplete feature of the IntelliJ IDE so far.
What I'd like to do, is cycle through the autocomplete suggestions I get when hitting Ctrl + Space without using the arrow keys (↑, ↓).
The reason for this is that I prefer to keep my fingers on the home row (I'm using IntelliJ's Vim emulator additionally).
For example, how would I select sortThis instead of sorted without using the arrow keys or the mouse?
Peter Gromov's answer brought me to a satisfying solution:
In IntelliJ's settings, for Keymap → Editor Actions → Down I set a custom shortcut: Ctrl + J.
This way I can cycle forward through the suggestions.
Setting a shortcut for Down with Selection or Scroll Line Down in the IdeaVim-specific shortcuts did not affect the selection of autocomplete suggestions though.
The answer here: https://stackoverflow.com/a/9713306/2370679 led me to discover that Ctrl+n & Ctrl+p allow navigation of the auto-complete options without having to modify any settings
For macOS the IDE will give a hint that "^↑ and ^↓ will move caret up and down in the editor". These clearly do not work.
There are a few extra steps that are needed after following #matthias-braun's solution.
Here is the full list of step that I use:
Go to Preferences -> Keymap
Expand Editor Actions (not Plug-ins -> IdeaVim)
Select Down
Click the pencil icon or right-click
Select Add Keyboard Shortcut
Press the shortcut (I use ^N)*
Repeat for 3-6 for Up (I use ^P)
Click Ok**
Go to Preferences -> Other Settings -> Vim Emulation
In the drop-down under the Handler column for the row containing Down, select Vim***
Do the same thing for Up
* If you are warned about the key binding already existing then remove it. You can always reset back to the defaults by clicking the little cog icon up the very top to the right of the drop-down menu.
** The Vim Emulation doesn't seem to be populated correctly until you reopen the Preferences.
*** I'm not sure why the Handler should be Vim. This seems backwards to me but it works.
If you're able to scroll up/down in editor with some IdeaVIM-specific shortcuts, they should also work in the completion list.
In this particular case, I'd just type another "t" so that "sortThis" becomes selected (and the only) variant.
I have done the same thing with mapping the arrows but in a more logical way:
I mapped them that when I press 'Alt' 'J' is left, 'L' is right, 'I' is up, and 'k' is down. that way I can have easy access to the arrows while my fingers are on the home row and I don't need to move them nearly as much...
I'm posting it just so people who search it on google can have that idea.

Visual Studio 2013 VB intellisense

Apologies upfront if this is a silly question, but it's annoying me to no end and I can't figure it out.
I'm using Visual Studio 2013 Professional, and I usually code in C# where when using the Intellisense, when I press Enter to select a method or something it adds my selection and I can continue typing on the same line.
But at the moment I'm working on a project which is in VB.NET, and when I use the Intellisense in the same way it puts my cursor in the next line, i.e. I press Enter to select whatever, it adds my selection and starts a new line, so I have to press the Backspace to go back to the previous line. It's so annoying!
Is there a way to change this behaviour so the cursor doesn't go to the next line? I've looked at the settings available in Tools > Options but can't figure it out, and searching Google for anything similar hasn't been successful.
Found it here (paragraph List Members)
You have toggled to suggestion mode instead of completion mode.
You can also change to suggestion mode, in which only the text you type is inserted into the code. For example, if you enter an identifier that is not in the list and press TAB, in completion mode the entry would replace the typed identifier. To toggle between completion mode and suggestion mode, press CTRL+ALT+SPACEBAR or click Edit/IntelliSense/Toggle Completion Mode.
So, either use TAB/SPACEBAR (as I said in the comment) or press CTRL+ALT+SPACEBAR to switch back to completion mode.
EDIT: I've found out that whenever you type Stri (String will show highlighted in the list now) and you press . (dot) it will autocomplete and stay at the same line.
I think your way of doing this in C# isn't possible in Visual Basic.
I had the same problem and discovered that Auto list members was not enabled on my machine. It's under Tools > Options > Text Editor > Basic > General. This gave me the intellisense I was looking for.
Simple thing which can be used when you face this kind of issue is to press
tab key instead of Enter key when the IntelliSense provided me prediction list.

intellij shortcuts

ctrl+shift+ (left/right arrows) (undo,redo) stopped working for me.
It used to be accurate but now I cant predict where it will take me.
It happened before, then got fixed, but now it looks like it is jumping to weird places.
cant make a sense out of it.
Same goes for the f4 in the form editor. it use to take me to declaration of the component in the code the but now it only puts me in the top of the class.
10x
Please refer to the list of the known issues with the back/forward functionality:
http://youtrack.jetbrains.net/issue/IDEA-63218
http://youtrack.jetbrains.net/issue/IDEA-64656
http://youtrack.jetbrains.net/issue/IDEA-65070
http://youtrack.jetbrains.net/issue/IDEA-63748
http://youtrack.jetbrains.net/issue/IDEA-63082
You might to check if you have accidentally switched the keymap. You can check it by following these steps:
Ctrl + `
switch keymap
choose "default copy"
One reason for this can be accidentally changed of keymap. If that is the case, we can change it to default. Follow below step for that.
Open Setting (Ctrl + Alt + s or File -> Settings) then select keymap from left side bar. Then select Restore Defaults like below image.
If your Restore Defaults is gray colored like me, then your keymap in the default state, which means nothing is changed. If not there is change.