AppCode 2023.1 Help

Controlling source, library and exclude directories

You can manage files and directories of your project from the context menu of the Project tool window (Alt+1).

Exclude from indexing

AppCode indexes your project files to enable such features as search, navigation, code completion, code generation, and refactorings. However, your project may contain files for which you don't need these features, for example, logs, binaries, or imported libraries.

In such cases, to reduce the indexing time, you can mark files as plain text and directories as excluded or libraries.

Exclude a file from indexing

If you want specific files to be ignored by code completion, navigation, and inspections, you can mark them as plain text files:

  1. Right-click the necessary file in the Project tool window Alt+1.

  2. Select Override File Type | Plain text from the menu.

To revert the changes, right-click the file and select Mark as <file type> from the menu.

Exclude a directory from indexing

If you don't want AppCode to index a certain directory of your project, do the following:

  1. In the Project tool window Alt+1, switch to the Files, Project Source Files, or Project Non-Source Files view:

    Switch to the Files View
  2. Right-click the directory you want to exclude and select Mark Directory as | Excluded:

    Mark directory as excluded

Code generation, code completion, and refactorings won't be available for this directory. The files won't appear in search results unless you select this directory explicitly in the Find in Files dialog Ctrl+Shift+F. The directory is marked as excluded the Excluded directory icon.

To include the directory back again, right-click it and select Mark Directory as | Cancel Exclusion.

Exclude a library from indexing

If AppCode considers an imported library as project files, do the following:

  1. In the Project tool window Alt+1, switch to the Files, Project Source Files, or Project Non-Source Files view:

    Switch to the Files View
  2. Right-click the directory with the library files, and select Mark Directory as | Library Files:

    Mark as library files

Code generation, code completion and refactorings won't be available for this directory. However, you can make these files available in search results:

  • In Find in Files dialog Ctrl+Shift+F: narrow down your search by selecting the Project and Frameworks scope.

  • When searching everywhere (press twice): check Include non-project items or select Project and Frameworks from the list in the top right corner of the window.

To unmark the directory, right-click it and select Mark Directory as | Unmark.

Manage files inside the Xcode project

Exclude from the Xcode project

You can delete a file or directory from the project structure keeping it in the file system:

  1. In the Project tool window Alt+1, right-click a file or directory that you want to exclude.

  2. Select Exclude from Xcode Project.

The file or directory won't be displayed in the Project view, but still will be available in the Files view. To return the file or directory into the project, in the Files view, right-click it and select Add to Xcode Project.

Mark a directory as project sources and headers

If you have a folder with source/header files, but the IDE doesn't consider them as project files, do the following:

  1. In the Project tool window Alt+1, switch to the Files, Project Source Files, or Project Non-Source Files view:

    Switch to the Files View
  2. Right-click the directory with the source/header files and select Mark Directory as | Project Sources and Headers:

    Mark as project sources and headers

To unmark the directory, right-click it and select Mark Directory as | Unmark.

Change project root

When you open a project, AppCode treats the location of the top .xcodeproj file as a project root directory. When you create a new project, AppCode also places the .xcodeproj file under the root.

However, your project may have a different structure. For example, .xcodeproj can reside in some subdirectory. When opening such a project, you'll receive a notification informing you that some files are located outside of Xcode project. You can find the same message in the Event Log tool window (View | Tool Windows | Event Log):

Change project root notification

In this case, the Files view of the Project tool window won't be able to display the project structure properly, and such project files as compile.sh and README.md won't be shown.

  • To explicitly point AppCode to the directory that you want to be considered as root, click the Change the project root link in the received notification and select the desired folder in the dialog that opens.

  • If you want to revert this change or choose another root, select File | Change Project Root from the main menu. Alternatively, press Ctrl+Shift+A and find the Change Project Root action.

After changing the project root, the project structure in the Files view of the Project tool window will be reorganized, though the actual files location won't be affected.

Last modified: 11 January 2023