Codeblock File Explorer doesn't show files - codeblocks

In the tab Files of my CodeBlocks I can't see files. The File Explorer shows me only the directory tree.
To load a .cpp file I need to go in my workspace directory, then I can chose to open it in C::B. The file is loaded in the IDE but I can't see it in the File Explorer.
If I create a new file by righ click on the direcoty in the IDE, I don't see the file there, but I will find the file in my workspace directory in the disk.

The File Manager plugin displays a tree-view of your computer's filesystem in the Files tab,
in which you can navigate to any directory or file in the usual way.
It's principal purpose is to let you browse and view files in the filesystem that are not in your project(s).
To browse, open and edit files that are in your project(s), use the Projects tab, where you
can navigate to any project in the workspace, and any file in any of the projects.
If you create a new file in the Files tab, all you have done is create a file
in the filesystem. If you want to add it to your project, right-click on it and select
Add to active project.... Then you will see it in the Projects view. And if you
do this, it would be advisable to create the file in your project's directory.
The usual way to add a file to your project and place it in the project directory
by default is to select File -> New from the menu-bar.

Related

Add Apache virtualhost logs to PhpStorm project files

I want to add some sort of shortcut to the C:\Apache24\logs\coreshop_demo.local.*.log files to the PhpStorm project files, so I don't have to navigate to the C:\Apache24\logs\ directory and open them in the editor manually. Is there a way to do so?
Well... you can create a symbolic link in your project folder that will point to that Apache's log folder. It will be displayed in the Project View as an ordinary folder.
Or you can add that folder as an Additional Content Root. Such an entry will be displayed in the Project View panel as an additional node (the project itself is a Content Root already) and will be an IDE-only solution.
For that go to Settings/Preferences | Directories and use "Add Content Root" button: https://www.jetbrains.com/help/phpstorm/configuring-content-roots.html

Create groups vs Create folder reference in Xcode

I'm curious when using Xcode.
I always need to choose an option when copying the open source class files I need for my project.
The options are "Create groups" and "Create folder references".
I've read the difference between the two already.
But it is not understood at all.
When I chose one of the two options, I deleted the file from my project and the open source class file was deleted at the same time.
I do not want it.
I want to always exist as an independent file. What should I choose?
It took me a while to understand the difference between those two options so I thought I'd share:
I'm writing this when Xcode 12 is the current version
The biggest difference is how the imported folder / file will be accessible from the finder. Let's say you want to import a new folder to your Xcode project. When you choose Create groups Xcode will import your new folder and create a group (the yellow icon). When you go to your project's directory (using Finder) you should see a folder named like the one you've just imported, but any additional files you put to this folder trough Finder won't be visible in your Xcode project.
When you choose Create folder references the imported folder will have a classic blue folder icon in Xcode. This new folder will also be visible when you go to your projects directory, but now every new file you put there will also appear in your Xcode project.
If you want to know more just read this explanation http://www.thomashanning.com/xcode-groups-folder-references/
It's pretty straightforward and easy to understand.
There are two types of any Xcode project structure organization:
filesystem project structure (inspectable with Finder.app)
IDE project structure (inspectable with Project Navigator in Xcode's navigator area.)
Xcode relies on filesystem organization by keeping a reference to a "physical" file or folder. That is why you may have all the classes, images, plists, and other parts of your projects stored in the same folder, while the references to these parts are being kept organized into respective groups within Xcode project.
When you create a group, it affects the organization of your project in Xcode. When you create a group with a reference folder, it creates both, a group in Xcode project and a folder in your filesystem.
However, since Xcode 9 it seems like, Apple enforces filesystem project structure to correspond to Xcode project structure. It means, that you explicitly has to choose "New Group without Folder"
Added files and folders from Finder into the Xcode group. Xcode 10.2.1. Just take a look at the examples without Copy items if needed
Files
Common behaviour for create groups and create folder references
Rename a file from Finder does not rename the file in Xcode, as a result Xcode doesn't handle it and it will mark them by red color.
Rename a file from Xcode rename the file in Finder
Change a file from Finder change the file in Xcode and vice versa
Remove to trash a file from Xcode change the file in Finder and vice versa
Add a file from folder in Finder does not add the file to group in Xcode
Folders
Common behaviour for create groups and create folder references:
Rename a folder/group from Xcode rename the folder in Finder
create groups
If you choose create groups, then the corresponding folder appears with a yellow icon in the project navigator.
It is just a virtual folder. It useful during development when you copy a file and it is not compiled and you do not have a time to make changes in it and want only to check if a project works. So you can just remove a reference from a file. It will not be removed from a folder as a result you will be able to add this file again.
Rename a folder in Finder does not rename a name of group in Xcode. You steal can work with group but previous content inside although visible but unavailable
Add a file to a folder in Finder does not add the file to group in Xcode
Add a file to a group in Xcode does not add the file to folder in Finder
Remove a folder in Finder does not remove the group in Xcode. You steal can work with group but previous content inside although visible but unavailable
create folder references
If you are choosing create folder references, then the folder appears with a blue icon in the project navigator.
It is a real folder and any changes will be reflected
Rename a folder in Finder does not rename a name of folder in Xcode. The previous content is gone and you can not work with this folder
Add a file to a folder in Finder adds the file to folder in Xcode
Add a file to a folder in Xcode adds the file to folder in Finder
Remove a folder in Finder removes the folder in Xcode.
[Copy items if needed]
Create folder references:
Useless because even if you list this folder to be included with a target, Xcode won't include any of its contents in that target and there's no way to click on something in the folder and see which targets it's included in.
Create groups:
This is the only way to go, if you want to include any of the folders' contents in a build target.

Code Blocks(New project/Rename main file)

When I create a new project in code blocks File->New->project->console application->Go->C++-><project title>->GNU compiler->finish (both debug and release box are checked), Then a project is created having .cpp file with name of main.
My question is how to rename this main file.
Before asking this question I have tried to solve it, but it includes many steps.
I have tried two ways (one way gives me a solution, and the other way indicates that file has been corrupted).
Actually I want to find a quick way to rename this main file?
If there is any method please tell me.
Two methods which I used(mentioning below)
File->New->project->console application->Go->C++-><project title>->GNU compiler->finish
then go to local disc (where project is saved) rename main file. Open project again in code blocks. Open main file it says file does not exist.
This method was quick but failed to rename main.
File->New->project->console application->Go->C++-><project title>->GNU compiler->finish.
then in code blocks at left side bar Sources/main/right click on main/remove file from project (then code blocks indicate you have deleted this main file but actually its not when I checked in local disk, main file was there). Then I create a new.cpp` file as File/New/File and next simple steps.
So finally I got what I want. A new project with .cpp file (name of .cpp file that I want). But I'm not satisfied, I want a quick method.
As of Code::Blocks 13.12 you can rename a file within a project
like this: Say the file to be renamed is main.cpp in project
MyApp.
In the C::B Management pane navigate in the Projects tree-view to
Projects -> MyApp -> Sources -> main.cpp.
Right-click on the file-icon of main.cpp. A pop-up menu appears.
The third item on the menu is Rename file. You can take it from there
Capture your code in a text file.
Close code::blocks
In the folder containing the files, rename all *.cpp and *.h or whatever your using including the cbp file. Don't need to change the depend or layout. Delete the bin and debug folders.
Double click the cbp (project file).
Remove the old files (right mouse click remove).
Then right mouse click on the project and select "add files".
Choose your newly named files, build and run.
In Code::Blocks 16.01, assuming your project and files are open:
If you want to rename main.cpp then, in the Management window, Projects tab, navigate to the Sources folder of your project and right-click on main.cpp. In the context menu that appears, if you find Close main.cpp menu item — click it! otherwise click Rename file...
If you want to rename the title of your project, in the Management window, Projects tab, right-click on the title of your project. In the context menu that appears click Properties... to open the Project/targets options window, and type the new title of your project in the Title field. NOTE that this will not change the name of the project folder or the name of your project's .cbp file, because the title of your project is stored inside the .cbp file.
If you want to rename any file or folder in your project, first close the project using the File menu, then, in the Management window, Files tab, navigate to the desired file or folder, right-click on it and choose Rename.... Proceed with care. You might want to delete old .dependand .layout files that are no longer associated with your project.
In newer versions of CodeBlocks, simply close the file editor and right click on the file (at left tree) -> Rename File.

On add existing item in VS2010, why can't I "add as link" a file from the same project?

I have two folders in my library project, folder A and folder B. Folder A will contain all the real files, but Folder B (and a bunch of other folders) need to contain links to the folder A files.
I tried going Add existing item (go to folder A)-> add (down arrow) -> add as link but the add existing item dialog window just closes and nothing happens. It seems I can add links to files outside the library project though. What's going on here?
-Isaac
For some reason Visual Studio seems to silently ignore possible problems with adding file as a link. I just had the same problem and the solution was to:
Check if project folder already contains a file with the name of file being linked, if so delete or rename this resource.
Visual Studio 2010 seems to cache project directory contents, as (1) was not enough to successfully link the file. Restarting VS helps.
Sound like Visual Studio is crashing for some reason. I just tested this in project that has many folders. I had an images folder and I was able to add as link and image to another folder, so it seems it is possible.
It does add the file to the project but does so to the original location, not the new location.
You can see this if you exclude the original file from your VS project (but don't delete the file from disk) - the file will then get add to your project in it's original location
e.g. if you have folder FolderA\index.htm and FolderB, and you want to create a link to index.htm in FolderB. Exclude index.htm from your project (but leave it in FolderA on the disk) so your project just has two empty folders. Right-click on FolderB and click Add Existing Item, select index.htm from FolderA and click Add as Link. The file will be added to your project but under FolderA (where it resides on disk) not within FolderB which is where you told it to add it.
So looks like a VS bug to me.
As has been mentioned, this is a valid scenario if you have multiple "root" websites within one project but you want to share resources between them
In my case (using Visual Studio 2013) I just had to show all files (button on the top of the Solution Explorer), right click on each file/folder and click on "Include on Project".

In Xcode, can you specify another default folder for classes, not Classes/?

If you create new files, and don't have a Classes/ subdirectory in the project root directory, Xcode dumps them in the project root. I'd like to specify where they go.
FWIW, I know you can link individual files a project to anywhere, with lots of options. Also, what I'm talking about here is the actual file system, not the groups, etc. that you see in your Xcode project.
Right-click (or control-click) on whatever group you want to put the files, and select the option to add a new file.
To put them in a specific location on the file system, select a Location in the drop down menu, or click the Choose button to pick a directory:

Resources