Navigating in source code

Noctule provides powerful features to navigate your Swift and Objective-C source files.

The global navigation actions are backed by SourceKit-LSP and work in Swift and Objective-C alike. The structure view is currently implemented for Swift only.

Structure view

The structure view tool window displays an outline of the current Swift file. Open it at View → Tool Windows → Structure , or as a popup with Navigate → File Structure .

Swift Structure View
Swift Structure View

The declaration surrounding the text caret is shown in the breadcrumbs below the editor and in the navigation bar above it. Both let you jump to an enclosing type or function.

Go to declaration

You can invoke Navigate → Declaration or Usages on a reference to navigate to its declaration.

Go to implementation

You can invoke Navigate → Implementation(s) on a protocol or class to navigate to the available implementations.

Find usages

You can invoke Edit → Find Usages → Find Usages on a declaration to show the list of usages in the current project.

Invoking Navigate → Declaration or Usages on a declaration shows the same list, because there is no declaration left to jump to.

Go to symbol

The names of declarations contained in Swift files are included in the Navigate → Symbol… search.

Call hierarchy

Caller and callee hierarchies are available via Navigate → Call Hierarchy… . Place the text caret on a reference or on a declaration of a function and invoke the action.

Type hierarchy

Type hierarchy navigation is available via Navigate → Type Hierarchy… . Place the text caret on a reference or on a declaration of a type and invoke the action.

Noctule Projects tool window

Since Noctule 4.0

The tool window “Noctule Projects” shows the Swift packages and Xcode projects of your IDE project. Open it at View → Tool Windows → Noctule Projects .

For each project, it lists the targets, schemes, tasks and package dependencies. From the context menu of a target, you can run, debug or build a target if supported.

Sync
Updates the IDE project with the data of the Swift project files, e.g. Package.swift. This updates the source folders, e.g. test source roots get a green background.
Initialize xcode-build-server
Available in the context menu of an Xcode workspace or project. It sets up xcode-build-server for the project.

Projects that Noctule didn’t detect on its own can be added with the “+” button of the tool window, or with Register as Noctule Project in the context menu of the project view, e.g. on Package.swift or an Xcode project.