VSCode: Searching into all project content - visual-studio-code

Since VSCode version 1.31 I can't find anything into my project files. I've already reinstalled the VSCode App on my Mac, but nothing happened on it.
This option doesn't work without open the files before:
https://code.visualstudio.com/docs/editor/codebasics#_search-across-files
I've been searching on the web, but I didn't find anyone with the same problem as me.
Please, help me!!

To make all your files visible in search you must always make sure all the necessary files are present in the same director. And then as Renee stated in the comments above, you should add your working folder to the Workspace or open folder from the start screen. Below are the screen snippets of the Visual Studio code's start screen from where you can file Add Workspace Folder button. If it is not found, you can always find it under File menu.

Related

Visual Studio Code has imported all folders associated with primary user of laptop,

I recently made VScode my primary IDE and it has since imported ALL of the folders associated with the primary user of my laptop. So folders associated with Dropbox, Applications, Creative Cloud, etc..etc.. are now showing up in the Explorer, under my name.
How do I remove these folders so that I can choose which folders I would like to open for my coding projects?
I can't find answers to this anywhere.
I've included a screenshot so that you can see what I am talking about.
Thank you in advance for any help you can offer.
enter image description here
vs code can be opened from a directory. it show all directory and file in pwd.
to open vs code in a directory you can execute code <path/to/where/you/want> in your terminal
As I understood, you are concerned that VSCode is showing all the folders you have when you open it up.
Let me clarify things for you:
Vscode is not an IDE, it's an advanced text editor.
Vscode does not import any files anywhere. It just works as a file browser;
it lists the files and folders of the folder that was opened in.
In your case, I think when you open up VScode, it's showing you the content of the /home directory (you are using linux or mac). If you want to open a specific folder, go to "Files" and then "Open Folder" and select the folder you want to open.

Visual Studio Code .vscode directory disappeared from workspace

Today when I opened my workspace in VS code, one of my extensions displayed an error message, telling me that there is some option missing in settings. I went looking for it in settings.json, just to find out my whole .vscode directory is gone along with settings.json file in it, and now I have to create everything from scratch once again. I checked reciclyng bin, it wasn't there either. I don't know whether it's a VS code problem, or somme Windows 10 shenanigans, but I can't be sure this won't happen again, because I have no idea how it happened in the first place.
If you are working on a collaborative project with colleagues or other devs then someone might have changed the settings in .vscode/setting.json
Check this issue
You can exclude files and folder to hide in workspace by adding files.exlude in the settings.json file

Visual Studio Code can't find files inside vendor folder (Laravel project)

I'm working with Laravel 5.5 and I use Visual Studio Code for code editor. After last update, VS Code freaked out. The main problem is that I can't search files inside vendor folder with ctrl+p. I can search and find any files except inside vendor folder. Does vendor folder disallow searching? I can't find anything related to this. Does anyone have a similar problem? Thanks!
Fix 1.
I am not sure how many projects you have but I think you can enable this by changing the excludefile settings.
Go to VSCode > Preferences > Settings or press ⌘,.
Search for files.exclude and make **/.git to false.
Fix 2
OR try to search for search.useIgnoreFiles in your settings and make it false.
You can find more details here.
Open User Settings
Search for: "Search: Use Ignore Files"
Uncheck: "Controls whether to use .gitignore and .ignore files when searching for files."

VS Code Explorer is not showing any project directory or files

I have this one project for which VS Code is not showing any files or directories in the Explorer tree
The actual project files and directories at the root are these:
VS Code is working fine for other projects.
How can I fix this?
Another solution: Go to Settings and check "Files: Exclude" in both "User Settings" and "Workspace Settings". Delete the files/folders needed to appear.
Try removing the folders inside ~/Library/Application Support/Code/ (except the User/ folder because that contains your keybindings and settings configurations) and then restart Code.
I had that same problem today (Version: 1.61.0) and fixed it by:
Opening ("Open...") another project on which folders WERE shown.
Opening the original project right after by selecting ("Open..."), but NOT "Open Recent".
This happened to me a while ago and it took me over a month to realize what was happening. In my case, for some reason I added the glob pattern "**/*" for the property Files: Exclude. Basically, I told vscode to exlude all the files in the project, just remove the pattern and you should be fine. I hope someone finds this useful.
The easiest way it worked for me was to drag the folders from Windows Explorer into VS Code. That restored the entire directory tree for me.
I was stuck on this for a while but I figured out it was a permissions error. Run ls in the terminal to see if you have the same error as me, if you do it should tell you permission denied.
The fix is very easy:
sudo bash
chmod 775 .
I was facing the same problem. I reinstalled the vscode and it worked for me.
Restarting VS Code was enough for me to get it working.
create a folder using terminal with command "mkdir folder-name" then go to "file" in menu and then to "open folder" then select the folder u used while creating mkdir. This woked for me.
go to the directory you want then press right click and press open with then select vs code

Disable Auto Generation of .vscode Folder

I often like to use VSCode to quick view some projects to pull snippets from them. However, this leads to a ton of additional .vscode folders being placed on my drive in any folder I use the right-click -> Open with VSCode option.
Is there a way to disable this folder from being created every time vscode loads somewhere new?
This issue was due to the 'C/C++ for Visual Studio Code' extension being outdated.
Upgrading to the latest version of this extension has fixed the problem.
That is not the standard behaviour of VSCode, normally the .vscode only gets generated once there is something like a launch.json put into it. Mind checking what's actually in there?