how to prevent vs code to don't access all my files - visual-studio-code

How to prevent vs code to don't access all my files?

The place where index.html is saved at is a folder that has many files inside. Please make another folder and put index.html inside, then go to File -> Open Folder and select the folder you just created. Now close the previous window and keep this new one.

Related

Remove subfolder from Visual Studio Code Workspace

My current workspace shows this directory. I would like to remove it so it doesn't appear in my workspace.
According to the documentation that I've read the way to do this is to go to File->Preferenceces -> Workspace Tab and the Add a pattern in the excludes.
However, no pattern that I've tried has worked.
I've tried
**/IVAPI/BKP_OLD_CODE/*
**/BKP_OLD_CODE/*
**/*BKP_OLD_CODE*
**/BKP_OLD_CODE
Then I click the refresh button on the worksapce explorer but the directory stills shows up. How can I add a patter so that BKP_OLD_CODE does not show up anymore?
You were very close, the fact is that, since its a folder, it does not have an extension or prefix! So just use the name of the folder (BKP_OLD_CODE in this case) and you are all done!

VSCode: Can I open individual files instead of workspaces?

Opening whole directories (each one requiring a new window) doesn’t play well with editing lots of little scripts/config files scattered in different folders.
Yes, you can! Here are three ways:
Either by running code {yourfilename here} in a terminal.
Dragging the file from a file explorer onto the open VSCode window.
Use the menu item "File/Open file... (Ctrl + O)", see image.
You don't have to open a folder in VSCode!
In VSCode create a New Window (instance) and open all the files you're interested in from anywhere on your disk.
If you want to keep this selection for later, you can Save Workspace As .. for later usage.

Adding Files to Xcode project

Trying to add file to the project!
Right click on the subfolder and selected add file to projectName. I added file which are required into my project[Destination unChecked and selected folders Create groups for any added folders and selected Add to Targerts projectNameTest], and close the xcode and reopen! the file which are added to the project is not appear's. Then again right clicked on the project selected add file's from 'workspace' and add to project [repeated same scenario] And close the xcode still files are disappearing from my workspace.
each time i need to add the file again and again from the work space. When I close the Xcode.
what i need to do for this issue so When i Open Xcode the files need to be appears into my workspace
What i do generally when I need to add extra source files to my project is :
1. Drag the file from source to my project.
2. I add Tick mark to the "Copy items into destination group's folder (if needed)" option.
3. Now i can seed added file into my project.
Hope!! this helps.
If you want to add files with a CLI, as I do, since I use a remote mac for development, you can check XCodeControl at github. This method is much faster than licking somewhere, at least if you hung over ;)

How to correct missing files in xcode iOS project

I have a project with some missing files. The files are their own folder on the same level as the iOS app project folder. Not sure why but the files are showing up as "missing"
Is there something I can do to the Library Search Paths (see screenshot below) so they find them correctly?
fyi: I inherited the project, so it was just sent to me. I try to build it and get all those files missing.
thanks for any help :)
It's nothing to do with library search paths, they are used to find libraries to compile against; they're nothing to do with source files contained within your project.
They are missing because your project file is trying to reference a location for the file that doesn't exist. You have two options:
If you have all the missing files on hand in Finder, you can delete the references to them in Xcode, and re-import them. Do this by dragging them back into the project from Finder.
You can instead 'fix' your project file, to have it refer to the right place. To do this, use the File Inspector on the right, and under Location, select the 'box' icon (not sure what it is, but select it), and relocate your file.
open the folder in which these files are present then drag and drop the missing files in you project. check the "copy items into destination group's folder(if needed)", choose "create groups for any added folders".
Remove these files from the project view (list on the left side), drag them back into the project and make sure you don't select Copy to project, but you also have to check which target to put in.

Maintaining Directory Structure when loading local files into UIWebview on iPhone

I'm noticing a minor annoyance when working with local files in a UIWebview and hoping there is a simple workaround. As a simplified example lets say in my xCode project I have a folder called "WebProject" that contains an html file and a subfolder called "images" where the images reside. The html file references the images as you'd expect: src="images/MYIMAGE.jpg" for example, which works just dandy if this where are normal webpage. When you load the html file in a UIWebview, however, this image would not show up because it seems that all of the files are just thrown into one big bundle folder (so the image link is actually: src"MyIMAGE.jpg"). Is there anyway to enforce the directory structure of these files in the main bundle, so that this sort of thing does not happen? Thanks!
Just create the structure you want in the filesystem (using finder or whatever) and import that whole tree into your project. Make sure you select "Create folder references for any added folders"
You'll notice these folders are blue instead of the normal yellow used for groups. This folder structure will exist in the bundle and so your relative references will work as you expect.
Hope that helps.
See this page and this tech note for how to add resources, and maintain directory structure. Make sure you select the radio button that says "Create folder references for any added folders." Then when you go to write your code, folder-relative paths to the bundle will resolve just as if they are sub-directories. Because they are, even in your app's resources.