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

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...

Related

Is there any way to highlight a file in the Visual Studio Code explorer?

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.

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

How to invoke a VS code extension by clicking on file?

I have the vscode-pdf extension installed which let's me directly view pdf files in VS code. Is there any possibility to open pdf files directly with the said extension by just clicking on the file?
The current behaviour when clicking on a pdf file is the following message:
The file is not displayed in the editor because it is either binary or uses an unsupported text encoding. Do you want to open it anyway?
Edit: I use VS Code version 1.40.2 1.60.0
Edit2: The feature mentioned in the answer to this question now seems to be integrated. Any update on this?
Not as of VS Code 1.41
However this is a good potential use case for the proposed custom editor api

Fuzzy file opening in vscode

I am exploring vscode after using atom for a long while. One of the things I'm missing is an equivalent of the lovely package advanced-open-file. Is there something similar to this in vscode?
I found the advanced-new-file extension, but it is only helpful when it comes to new files. I would like to be able to quickly open files from all over my local files (not only the workspace).
Edit: I found the option of workbench.action.quickOpen; but it doesn't allow opening files from the whole file system.
Sorry, but currently the answer is no. The problem is that input box doesn't provide a way to listen to key events:
GitHub issue,
so even the extensions can't do that currently. Here's the comment from advanced-new-file extension creator:
Because VSCode extensions don't yet have the ability to do type-ahead autocomplete within the text input box (See https://github.com/Microsoft/vscode/issues/426), we work around this limitation and provide autocomplete using a two-step workflow of selecting existing path, then providing new filename/path relative to the selection.
The good news is that there is a new API addressing this issue, but it's currently in 'proposed' state and can't be used for published extensions.
One workaround could be typing code -r some/path in integrated terminal and using 'tab' for autocomplete.
The Fuzzy search extension seems to work for me.
It adds a new action to the command palette which allows you to search for files in the current project and open them.

visual studio code quick open shows only visited files

I just started to use vscode. It seems I can't correctly use Quick open (Control-p). It only shows already visited files. Is there some configuration I need to set to change this behaviour?
I'd like to open them in fuzzy way and I seem to understand that it should be possible but again that doesn't work. My (django) project has 7/8 files named 'models.py' but if I write 'mdl' I don't find anything. Nor it does if I write part of the directory name.
I'm using version 1.18.0-insider
sandro
*:-)
Solved: it seems it all depended on a wrong pattern in file exclude. I added '/.pyc' when the correct pattern was '*/.pyc'. I realized when searching and an error was raised.