Is there any way to highlight a file in the Visual Studio Code explorer? - visual-studio-code

As a reminder, I would like to be able to highlight a file (in Explorer) that I have made important changes to. Highlighting it would make it easy to find again!

Visual Studio Code still doesn't provide such a feature. If you have source control, it will allow you to track modified files unless it is not available yet.

Related

How to keep open file input in Visual Studio Code when I change of window?

I would like to know if it is possible to keep this search engine (Ctrl-P) open if I change the window, in Visual Studio Code.
It is a not very relevant functionality but it would help me when I forget part of the name of the file I want to search for or I have to change the window to solve another situation, however, when returning to Visual Studio Code the file browser closed itself and I must return to write part of the file path from the start.
Is there a configuration or extension with this functionality?
Thank you very much!
No, you cannot keep that open when you change windows. Since the search engine provides compilers or lints for various languages that you are editing in the ide space. So when you open a new window by default VS code provides a different configuration for the script, so the search engine cannot be kept open.
A detailed description can be found here https://code.visualstudio.com/docs/getstarted/settings

Visual Studio Code Automatic Preview Mode on Sidebar navigation?

I've recently moved to Visual Studio Code from Sublime Text.
Something that I'm missing is the "automatic preview mode" (I don't know the exact name): in ST, if I navigate the files in the sidebar with the keyboard, every file is automatically opened in a (static) preview editor.
I couldn't find anything similar in VSC. The most similar functionality requires me to single-click, but I have two problems with this:
I'm a "keyboard-prevalent" user, and (single-)clicking defeats the purpose;
in ST this happens automatically, so it's faster anyway.
Am I missing something?
I've been searching for a while, but can't find anything relevant. It seems there are references to this functionality from Search Files (Ctrl+P), but I'm looking this functionality on the sidebar, since I use this while working on files of a single directory.

Auto-saving files upon changes with Visual Studio Code

I have used WebStorm from JetBrains for almost four years now. It's a fantastic IDE for many reasons, but one of the best features is that it saves versions of files outside of version control. So if you accidentally delete files or lose files before they are saved by your version control system, WebStorm has a copy of them and there are visual diff tools to use. This feature has saved me on more than one occasion.
For Visual Studio Code, is there some feature/plugin that will auto-save copies of files as they change? Will Visual Studio Code save the files to some central location, or perhaps in the .vscode folder in the local workspace?
The feature in WebStorm is available from Local History → Show History from a folder or file. Here is an article about it:
Using Local History for code changes tracking
The view looks like:
You can go to menu File and choose Auto Save.
You can enable auto save with these methods:
Check the Auto Save item in the File menu
Go to Settings, search for auto save, and select the auto save option (afterDelay)
Auto save description in Visual Studio Code documentation
Yes, Visual Studio Code can auto-save changes on files as you make changes. It also allows you set a delay for how long to wait before saving the file.
Here's a link that should help you with that.
Or a shortcut you can simply navigate to your Visual Studio Code settings, and add the following to your settings.json file.
{
...
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 1000,
...
}
This will instruct your editor to autosave after a 1000 ms delay. You can set the autosave option to onFocusChange to autosave whenever you move your cursor away from the current text area.
There's a package called Local History that can be used to save a backup of your files outside version control.
You should check that out.
As of March 2022 (version 1.66), Visual Studio Code has a built-in feature called Local History that automatically creates commit-like versions of your files on every save.
It is enabled by default, but you can double check the setting workbench.localHistory.enabled to make sure it is enabled in your project.
From the reference:
Each local history entry contains the full contents of the file at the time the entry was created and in certain cases, can provide more semantic information (for example, indicate a refactoring).
From an entry you can:
Compare the changes to the local file or previous entry.
Restore the contents.
Delete or rename the entry.
The saved local versions are accessible from the Timeline section in the File Explorer tab.
Also, ensure you add .history to your .gitignore file, so Visual Studio Code doesn't track every change made to a single file as changes made to multiple files. This can be a problem and make your files changed so large even though it's a single file or a few files you made edits to.

Visual studio code extension: How can I add error markers to files in the explorer?

I have written a validator for my vscode extension, which uses a DiagnosticCollection to set errors for files. This works and the errors are shown when a file is opened.
I would now like to mark files in the explorer, so that it is easy to find files with errors. Here is an example]of how it looks in Eclipse:
Is it possible to do this in a vscode extension? Is there already an extension doing this?
Unfortunately, you can't do that.
There is an open issue asking something related to Git, but not as open as you want. Maybe using the API described in this another issue you could create a new panel with the marked files.
It is still experimental, BTW...

How to hook into the Visual Studio IntelliSense completion keys to change when it triggers

Visual Studio 2015 does not have a way to only select IntelliSense when I press Enter or Tab anymore in C# for 2015. It's available for JavaScript but not C#.
I'm trying to create a MEF project and hook into the IntelliSense to change this behaviour for C# files. Just to get started, I tried to implement this sample plugin from Microsoft:
https://msdn.microsoft.com/en-us/library/ee372314.aspx
The sample compiles, but it does not work. Nothing in the code is triggered from the debugged IDE. The samples tells to start a new text file and press "a" to get demo IntelliSense, but it never trigger.
Here's the code project if anyone want to look into it:
http://ontime.zdata.no/donwload/ProperIntellisense.zip
Could someone guide me in the right direction here, the documentation in this area is very fluid.
There isn't a supported way to use the APIs to customize this. The behavior you're looking to change falls under the Roslyn project on GitHub so you're more than welcome to file a bug there as feedback. You're also welcome to send a pull request, but at this point it's really tricky to make a change to the editor components of Roslyn and apply those to your locally installed Visual Studio. It's something we're working on fixing but it's not done yet.
The workaround is to press Ctrl+Alt+Space when inside the editor. That will toggle into the correct IntelliSense behaviour. Not a very easy thing to find, but it saved my day. They should probably give better information about this toggle feature, and make it more visible.. Still, it will not be remembered after closing the IDE, so you have to do it every time you start the IDE.