Can't edit files in Vscode - visual-studio-code

I've just started using Vscode and have a created a WebAPI project. On trying to open any of the default code files (Startup.cs and Program.cs) whatever I type starts to appear in the blue bar as shown below instead of where I have placed the cursor. I have no idea what's going on or what that blue bar is.
I am able to add my own code files and edit these as I would expect.
I'm running Vscode 1.29.1 on Win 10 on a Dell Latitude 12 7275. The vscode extension
Enabled extensions :

That's caused by Vim extension. Uninstall or disable it, otherwise use insert key on your keyboard to put it in insert mode.

I'l leave this here for future readers
Basically, if I split files in tabs in VS Code, I could work with the files on the left hand side but could "read-only" all the files on the right hand side.
When I went to the extensions tabs I noticed that whatever I typed was being typed in the field in the extensions search bar. After deleting that, and clicking back on the "Files" tab, it went back to normal and can basically edit files on the both sides of my split screen.
If cannot type
Check where whatever you type is going (e.g. Extensions > Search bar)
Delete wherever it's being typed, and click back on the "Files tab"
Check if it works

I had to change the parent folders permission...
Try changing the entire folder to:
Read & Write: Allows a user to open the item and change it.
https://support.apple.com/guide/mac-help/change-permissions-for-files-folders-or-disks-mchlp1203/mac

Related

VSCode search is not updating live for one specific file, otherwise works

This is a weird one.
I press CMD+SHIFT+F to open the search across files sidebar. I type a word that is found in multiple files.
I click a result in file A, I change the searched word and the sidebar updates instantly, without even saving the file
I click a result in file B, I change the searched word and the sidebar doesn't update. I save the file, still no update. I have to perform the search again by pressing the Refresh button above the search bar (never used it before) and only then it updates.
The Search in Open Editors thing is turned off, I don't have regex or anything else enabled, Exclude settings and Ignored files is turned off (doesn't make a difference anyway), there are no updates waiting, I tried restarting VSCode. I'm out of ideas, this is driving me mad. Help!
EDIT: When I rename the file it works!!! What?

Neovim/Spacevim - Display Function/Method Name Cursor is Located in

I recently switched to using Neovim/Spacevim, and it's freakin' awesome! I have been trying to change some settings and install plugins to emulate as close as possible to my previous VSCode development environment.
I'm nearly there, except the only thing missing is one feature I really loved. In any file, wherever my cursor was located, at the top of the status bar in VSCode, it would display the function/method (or variable, object, etc.) name.
Does anyone know if this is possible in Neovim/Spacevim. If my cursor is located within a function named someFunction, how would I get someFunction to be displayed somewhere in the status bar? I am using the standard statusline bar, no plugins for that (though am willing to install one if it does what I need).

How to enable again the tooltip/hint in VSC?

My VSC shows the wavy underlines when something's wrong with my code, but does not display the hint overlay when I hover my mouse on it.
This happens whatever the language used (from CSS to Typescript) and whatever the type of irregularity (e.g. notice, warn, danger)
I'd say that's a setting I may have changed at some point, but can't find which one. Any idea?
More details:
I do have the message displayed in the Problems tab besides to the Terminal, but it forces me to switch from tab to tab ;
I do have other overlays like autocomplete/autosuggest ;
No extensions in my setup could have led to that situation (only a few installed, widely downloaded, nothing fancy or dodgy).
Actual behavior (nothing happens):
Expected behavior (from google images)
Go to File > Preferences > Settings.
Search for 'hover.enabled' (See below photo).
Toggle it.
If your editor still does not pick up the change, close all tabs, close all VSCode windows, and reopen it.
If it's still not working, try uninstalling VSCode and reinstalling it (make sure you don't have setting sync on).
Also, this question has been answered in at least one other place (Disable tooltip hint in Visual Studio Code)

Disable keyboard navigation in file explorer after 1.31 update

Update 1.31 added keyboard navigation to tree widgets, where it will now filter items in the file explorer tree based on a search result.
Previously, when the file explorer was focused, I was able to use A or shift+A to create a new file or folder in my current directory. I am now unable to do this, as any keystrokes enter a filtering mode in the tree, rather than performing the keyboard shortcut.
The developers have added a setting to control this: workbench.list.keyboardNavigation, however none of the options appear to revert it to the old behaviour.
Changing this option simple, rather than the new default highlight, allows the keyboard shortcuts to work as they did previously, however the new file/folder I create are now created in what feels like an arbitrary location in the file tree, rather than the current directory which was the previous behaviour.
If anyone could shed some light on how to revert back to the previous functionality, or if I am misunderstanding how the simple behaviour works, that would be great.
For anyone stumbling across this question, this has been solved as of the 1.32 update. With the tree focused, press / to toggle between filtering mode and operation mode.

Visual Studio Code - Tabs (editors) of the same project in multiple screens

Using multiple screens I normally place multiple classes (files) in different screens, this helps me a lot while refactoring, checking tests and comparing changes.
Visual Studio Code does not allow me to drag a tab outside the window and view it in (for example) another monitor.
I checked the documentation and plugins, but the only way I found, is to open two windows, pointing to the same project (folder) and put those in different screens.
I don't like this solution, that causes also some problem when I watch code changes using TypeScript.
Any suggestion?
I use Windows 10, latest version of VSCode.
A solution is to press CTRL+K and after releasing CTRL, press O.
This will open the current file in a new window.
There are few things I don't like about this solution:
- Drag and Drop does not work
- Create a new instance of VS Code resulting in (for me) 180MB of ram used
- To open the file it takes to me few seconds (quite slow)
- The file remains open in the original window as well
Update 20/03/2019:
There is a feature request you can track here:
https://github.com/Microsoft/vscode/issues/10121
And an explanation about why this is difficult to implement here:
https://github.com/Microsoft/vscode/issues/10121#issuecomment-345770248
Update 20/03/2019:
Another important side effect highlighted by #Mär is that:
the IntelliSense fails to establish references it had when the file
was opened in the window, where the entire project is opened
The easy way but with the same drawbacks. More ram and resources will be used. Is to wrap your project in a folder.
It's the best possible thing. As by now!
=> Duplicate the workspace.
Open the command pannel ctrl+shift+p or F1.
Then write dupl
You'll get that
That's it.
More
If you want to add more folder to the working space.
=> go to File then Add Folder To Workspace
You can add as many as you like.
 Also better more
You can open a new window (ex: ctrl+n)
And then go File > Add Folder To Workspace.
And start adding folders to your new Workspace. You can add any folder, that is already open or not. That's too way great. You can have all the needed folders for example in the second screen.
A little hack I used is to just stretch the editor window to fill both screens and split the view pane between the monitors such that both screens show just one open file.
This is a cheap hack that works without opening multiple instances of VSC.
It may not be the proper solution, but it works without eating up all my system memory.
I found the following way to work on multiple monitors (important: they must be the same size and resolution):
open a visual studio in windowed mode on the 1st monitor (in my case it is a left monitor)
move the window to the (left) top corner
stretch window to the 2nd monitor (right) bottom corner
split screen by clicking “split editor” several times
move the code sections separator to the edge between the monitors
This is old qestion, but such way can be useful for someone. It is not very convenient, but it works. The solution may have already appeared in the VS itself, but I didn't find it.
Visual Studio Code does not allow me to drag a tab outside the window and view it in (for example) another monitor
Actually, VSCode 1.57 (May 2021, 4 years later) will propose something close:
Improved editor drag and drop across windows
Support for dragging editors to other windows was improved in this release. You can now drag diff editors, custom editors and the entire editor group to another window to open the editors there.
My solution was to use Remote-ssh to connect to self and open in another window. This does take extra resources. But I find this comfortable as I don't need to create additional workspace.
For me on Ubuntu the solution was to create a project folder symlink and ope it in a new window (as it won't open the same folder in another window)