GoLand 2024.1 Help

Indexing

Indexing in GoLand is responsible for the core features of the IDE: code completion, inspections, finding usages, navigation, syntax highlighting, and refactorings.

It starts when you open your project, switch between branches, after you load or unload plugins, and after large external file updates. For example, this can happen if multiple files in your project are created or generated after you build your project.

Indexing is in progress

Indexing examines the code of your project to create a virtual map of types, methods, objects, and other code elements that make up your application. This is necessary to provide the coding assistance functionality, search, and navigation instantaneously. After indexing, the IDE is aware of your code. That is why actions like finding usages or smart completion are performed immediately.

While indexing is in progress, the above-mentioned coding assistance features are unavailable or partially available. Nevertheless, you can still work with the IDE: you can type code, work with VCS features, configure settings, and perform other code-unrelated actions.

Viewing the indexing process

The right part of the status bar shows the progress of the indexing process. You may select Show all to view the specific tasks in the Backround Tasks dialog.

Indexing is in progress

There are two main background tasks that are part of the indexing process: Scanning files to index and Updating indexes.

Indexing is in progress

In order to have access to smart IDE functionality such as code completion and smart navigation, the Updating indexes process must have completed. However, the Scanning files to index process can still be in progress because it does not interrupt the access to smart IDE functionality.

Decreasing time for indexing

The amount of time required for indexing varies depending on your project: the more complex your project is, the more files it comprises, the more time it takes to index it. You can decrease the indexing time by excluding files and folders and by unloading modules.

Exclude files and folders

Marking dynamically generated files as excluded can speed up the indexing and overall IDE performance. For example, it's recommended that you exclude compilation output folders. Excluded files remain a part of the project, but are ignored by code completion, navigation, indexing, and inspections.

Exclude files from indexing

  1. Right-click a file in the Project tool window .

  2. Select Override File Type | Plain text.

    Plain text files are marked with the Plain text icon.

Exclude folders from indexing

  1. Right-click a folder in the Project tool window (Alt+1).

  2. Select Mark Directory as | Excluded.

    Excluded folders are marked with the the Excluded root icon icon.

Exclude files and folders by name patterns

In some cases, excluding files or folders one by one is not convenient. For example, this may be inconvenient if your source code files and files that are generated automatically (by a compiler, for instance) are placed in the same directories, and you want to exclude the generated files only. In this case, you can configure one or several name patterns for a specific content root.

If a folder or a filename located inside the selected content root matches one of the patterns, it will be marked as excluded. Objects outside the selected content root won't be affected.

All files within excluded folders will be excluded as well.

  1. Press Ctrl+Alt+S to open settings and then select Project Structure.

  2. In the Exclude files field located at the bottom of the dialog, enter a pattern. For example, enter *_test.go to exclude test files.

    You can configure multiple patterns and separate them with the semicolon symbol (;).

    go_exclude_files_folders_by_name_patterns
Last modified: 28 May 2024