Visual Studio code always opens the wrong file for me - visual-studio-code

I have a very weird problem with Visual studio code (Version 1.20.1 (1.20.1)).
In full screen mode on a Mac. (High Sierra) when I double click a file. it always opens the file above it. Meaning that it opens the wrong file (not the one which I double clicked).
Please have a look at this video which I recorded.
https://youtu.be/VG8-AnEpZjY
The video starts with me double click on the file "Tables.scala" but the editor opens the file "ScanFromCassandra" which is above it.
Then I double click Models.scala and it opens the file correctly.
Then I double click Config.scala but the editor opens CommonFlow.scala
This is very very annoying. I don't know if anyone else is facing this issue or not.
Edit:: If I switch off the "open editors" window, then the issue disappears. but I like the "open editors" window. I think the open editors window causes some kind of "jumping" in vscode making it open wrong files.

Actually I figured out the answer after using the editor for some time.
in VSCode when trying to open files in the "explorer" we have to single click on the file name. not double click.
If I single click on the file name it works perfectly.
The problem comes when I double click but that's not required. a single click on the file name to open it works smoothly.

Related

Why LiveServer extension in VS Code does not open the right HTML?

I want to use LiveServer to quickly live view one HTML file index.html, which i created on the fly.
But Everytime I click on button Go Live on bottom-right corner of VS Code, it opens another HTML file (under folder TailwindCSS in workspace .
What on earth is going on? LiveServer extension is not intuitive at all as its guide shows ! This malfunctioning LiveServer extension has wasted me 1 hour !!
Right-click the main file you want to open in the live server and click on "Open with live server". This might work.
I had the same problem. I just had to open the whole folder via File->Open Folder.

Visual Studio Code replaces my opened tabs when opening file from Finder

I'm using Visual Studio Code v1.21.1 on macOS Sierra.
I have a workspace with about 9 or 10 tabs with the files that I used all the time. But if I want to open a new file associated with VSC by double clicking it on Finder, instead of just opening it in my current instance as a new tab, it closes the instance (with all the other 10 files) and opens alone.
I can't find any setting that changes this behavior to what other editors do, and which is basically opening a file from the operating system's Finder in a new tab, whilst keeping all my other stuff opened.
This happens because of preview mode in VsCode which opens the file as a preview (the file opened as a preview will have italic file name), you have to pin the preview by editing or douple clicking the tab.
you can also disable the preview mode from the setting screen under
workbench.editor.enablePreview
you can find detailed explanation here https://www.brcline.com/blog/force-vscode-open-files-new-tab

Opening file in VSCode Explorer using keyboard

When I press Command+Shift+E (Mac) to set focus to the explorer in Visual Studio Code, I can navigate using the up and down keys to select a file, but I can't open the file in the editor. I can press Enter to rename it, but I couldn't find a way to open the file using the keyboard. Is there a way?
Correct shortcut to open a file is: CMD+down
Just for the record, this is the standard shortcut in any properly behaving OSX application, for example Finder.app (and it's the reason why Return/Enter renames a file)

Eclipse - Can't View or Open Java files in Package Explorer to Editor

I clicked something or accidentally drug a file that was open in the editor and now it is no longer displayed.
If I double click on the file in Package Explorer it doesn't show in the editor like it used to. I have looked all over and can't figure out how to get this file back in the editor.
I thought clicking File - Open File would do it but that displays an open file dialog.
Another way to simulate this is to put the cursor in the editor for an open file and select File - Close. This closes the file but then if you double click on the file in the Package Explorer it doesn't open it in the editor anymore. How do I get these files to display in the editor again?
I also tried right clicking on the file and selecting "Open". This does not display in editor either.
I also tried right clicking and selecting "Open With Java Editor". This does not work either.
If I clicke "File" and then the name of the file in the MRU list . This does not work either.
Also, double clicking a file in Package Explorer fails to open any file. The file shows in the File MRU list but does not display in editor. Can not figure this out.
Also, if I select "Back to" or "Forward to" arrows on toolbar, it tracks the file in the Package Explorer by highlighting it but the file does not display in an editor like it used to.
Also, I have tried "File Open" browsing to the physical location and selecting it but that does not display in the editor either.
I had to open a new window (Window - New Window) and then Reset Perspective (Window - Reset Perspective) to get the editor back. Not sure why but I lost some of my perspective settings doing this.
In Package Explorer, instead of double-clicking on the file, try to right-click it and you should get several "Open with..." options; choose the one that matches the editor in which you want the file to open.
Your choice will also be saved as the default, so the next times you can just double-click and it will open in that same editor.
If you are customizing the perspective, then saving perspective could be a safer option to avoid such glitches.
PFB the link on how to save a perspective:
http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2FgettingStarted%2Fqs-43e.htm

Netbeans: how to change the default tool which opens .txt file?

I was living in peace and netbeans used to open text files in the netbeans editor. Then one fine day I wanted to open 1 of the text files in a web browser (to render some html, and I didn't want the headache of making a new html file. Yup, yup, I know I was being a fool). So I right clicked the file from inside netbeans and chose an 'open as' option and used treat file as "html/text" expecting it will open in the browser. And to my surprise the browser did come up and tried opening the file. But then all the text files now always open the browser and none of them get opened in the netbeans editor, no matter how hard I try, and netbeans no longer shows the 'open as' option when right clicking the text files.
Can some one suggest some way to fix this ?
Try going to Tools->Options then click Miscellaneous and then the files
tab. There should be an associations editor you can use to change this.