How to hide html output files when using pug in vscode? - visual-studio-code

How do i disable seeing the .html files when there is a pug file in visual studio code? Right now in my file explorer on the left i see both the .html and the .pug files.

I found the answer to this after some searching. Open .vscode folder and open the settings file and add the following code snippet:
"files.exclude": {
"**/*.html": { "when": "$(basename).pug"},
}
Html files will now be hidden. You can do this for other file types as well.
I couldnt find a way to do this through the settings editor in the app, had to do this manually with the config files.

Related

How do I open a <GameScene>.unity file in VSCode without using windows file explorer?

So I was working on a project in unity, and I just realized that it nevers shows the gameScene files(.unity files) in VSCode's File explorer. The only way I open it up in VScode is using the windows file explorer.
Also the contents in the files aren't coloured as if I am reading a .txt file
So my question is there any way or extension to open .unity files directly in vscode?

Where is the 'launch.json' file in Visual Studio Code?

The launch.json file should be inside the .vscode folder, but it is not present there.
How can I get this file so that I can modify the configurations?
As described in the Launch Configurations section of the Visual Studio Code documentation:
VS Code keeps debugging configuration information in a launch.json
file located in a .vscode folder in your workspace (project root
folder) or in your user settings or workspace settings.
To create a launch.json file, click the create a launch.json file link
in the Run start view.
As of Visual Studio Code 1.56:
Once that's created, it should now be available under your workspace's .vscode folder.
Click on the debug side bar to open the debugging options. Then either the cog icon at the top, or the create a launch.json file link below the big blue button. If the launch.json file is present, it will open it otherwise it will generate one.
Warning: if you try to create an empty one (or one with an invalid content), trying to get to that file through the "Create a launch.json file" would not do anything.
See issue 133327.
That will be fixed with VSCode 1.61 (Sept. 2021): at least, that existing file will be opened when you click on "Create a launch.json file".

How do I open the 'launch.json' file in Visual Studio Code?

I am a new programmer that started learning Python, but there's something bothering me which I'd like to change.
As I've seen that it is possible to remove the unwanted path from the terminal when executing code, I cannot figure out how to access the Visual Studio Code launch.json file and all of the explanations on Google are quite confusing.
Note that if Visual Studio Code hasn't created a launch.json file for your project yet, do the following:
Click the Run | Add Configuration menu option, and one will automatically be generated for you, and opened in the editor.
NOTE: You have to have a "Folder" open, for this to work. File | Open Folder...
In Visual Studio Code, use shortcut Ctrl + Shift + P to open the Command Palette and type Open launch.json. And it will open the launch.json file for you. If you also can't open launch.json then try the way below.
Check if the .vscode folder exists in the root folder. If not, then create a new one and create file launch.json in that. Now you have launch.json for your workspace and you can configure your project.

VSCode code autocomplete behavior

I noticed that VSCode uses only the files that are opened in editors (tabs) for looking up names for code auto complete. It is strange for me. To my mind the more usual behavior is to look up all files in opened folder, but not use only the opened files. Is this behavior by design ?
Try creating a jsconfig.json file at the root of your workspace:
{
"exclude": [
"node_modules"
]
}
This tells VSCode to treat all JS files in your workspace as part of a single project, even if the files have not been opened yet. You can find more information about jsconfig.json files in our documentation
Actually, to consider the opened folder as JS project, the "jsconfig.json" is required. Read more here

In visual studio code: How can I exclude files from Quick Open but no from the explorer

I have a TypeScript project that I edit using Visual Studio Code, and I found that I can exclude files from Quick Open (cmd+P) by configuring files.exclude like this
"files.exclude": {
"dist/**/*.js": true
}
This hides from me the compiled files when I use Quick Open which is what I want. The problem is that, this code also hides the file from the File Explorer.
Is there a setting that excludes the files from Quick Open and Search but still list them in the explorer? Ideally using a dim color indicating "private", like atom does.
please try,
"search.exclude": {
"dist/**/*.js": true
}
Open settings (cmd/ctrl + ,) and then search for "exclude" and press "Add Pattern"