Sourcetrail 2019.3

Author: Eberhard Gräther

The Sourcetrail 2019.3 release introduces the new Custom Trail dialog to query and display custom graphs that show connections between any two symbols. Additionally, the new release brings Precompiled Header (PCH) Support for C and C++ projects to speed up the indexing step.

Type composition graph, created with our new Custom Trail Dialog.

New in this Release:

  • Custom Trail Dialog: Display graphs with custom origin, depth, filters and optional target
  • Precompiled Header (PCH) Support: For C and C++ Source Groups
  • Directory in File Title: Optionally show file directory in code view file title.
  • Authenticode Signing for Windows
  • Python Indexer Updates: See Changelog
  • Fixes & Improvements: see Changelog

You can download Sourcetrail 2019.3 here. The full changelog is available here. As usual, going into some more detail, I will now outline the most important updates new in this release.

Custom Trail Dialog

Users have frequently asked for better access to our graph data and breaking free from the one-level-of-dependency constraint for our default graph. Our first step here was the introduction of the Depth Graph Controls in the top left corner of our graph view. They offer certain predefined options: When a class is selected they show base and derived inheritance hierarchy, for functions they provide a call graph, and for files the include hierarchy. This set of features covered the most frequent use-cases, but offered little flexibility.

Our users requested even more control of what nodes and edge types should be part of a displayed graph. Another common request was making Sourcetrail capable to query for code paths between certain symbols. With our new Custom Trail Dialog we satisfy both requests. The Custom Trail Dialog can be accessed within the trail controls in the top left of the graph view.

The Custom Trail Dialog is accessed from the Trail controls in the graph view.

To create a Custom Trail, you first need to specify an origin symbol. Our already familiar search field is reused for searching a symbol, which offers the exact same user interactions as our main search field.

Then you can choose one of three modes:

  • To Target Symbol: Specify another target symbol. The graph will only contain paths from the origin to the target symbol.
  • All Referenced: The graph will only contain nodes that are referenced by the origin symbol
  • All Referencing: The graph will only contain nodes that depend on the origin symbol.
The new Custom Trail Dialog for creating custom graphs.

The Custom Trail offers some additional options:

  • Maximum Depth: Define the depth of the resulting graph. When searching paths from origin to target, all paths that are beyond this depth will not be found.
  • Layout direction: Define if the graph should be displayed vertically or horizontally.
  • Node Filters: Define which node types will be part of the resulting graph. This setting is ignored for the origin and target nodes.
  • Edge Filters: Define which edge types will be part of the resulting graph. The special edge “member” defines whether parent-child relations are considered as edge.

Please note that available node and edge filters depend on the currently loaded project and language of the project. Only available node and edge types will be displayed.

Custom trails for override hierarchy, access paths to a field and include hierarchy of a certain header.

Some users would have preferred a textual query syntax instead of a GUI dialog. We decided in favor of the GUI dialog, because it is more approachable, all options are visible and there is less need to consult the documentation. If the demand for a more powerful query syntax is high, we may consider adding this feature in the future as well. Please let us know what you think!

Precompiled Header (PCH) Support for C/C++

Precompiled headers can greatly improve compilation time. They store function and type declarations of a certain header (and everything that’s included) in a .pch file and reuse this information for multiple translation units, without loading and parsing these header files over and over again. With our new release, our C and C++ indexer can also make use of this optimization to reduce indexing times.

Precompiled Header (PCH) options within C and C++ source groups.

This release adds Precompiled Header (PCH) Support for C and C++ Source Groups Empty and from Compilation Database. To make use of this feature, you first need to specify the path to the input header file that shall be precompiled (e.g. stdafx.h). Then you can define if already specified compiler flags shall be reused for PCH generation and which additional flags shall be used. The .pch file will be generated as pre-indexing step.

Please note that the .pch file must be generated by Sourcetrail. You cannot reuse an already generated PCH file from your usual compiler.

Directory in File Title

Some users approached us with the request to show the path of the displayed file above the source code instead of just showing the file name. Sometimes the directory is important to know, especially when the code contains multiple files with the same name. This information was already available within the tooltip when hovering the file title, but this was too slow and cumbersome for some users.

Relative directory path in front of file name.

With this release we added the new “Directory in File Title” option to Sourcetrail’s preferences. When enabled it will show the directories relative to the project location within source file titles. The path will be elided at the front if too long for the available view size.

We made this an optional preference, because depending on the file structure of the project, it can also lead to substantial clutter. For that reason we wanted to leave it to the user to decide whether directories should be shown or not.

Closing comments

Thanks for reading, we hope that you like our progress! Don’t forget to download the new release.

We recently started to provide our users a better overview of what is planned for upcoming releases. Take a look at the milestones on our bug tracker to get an idea of what will be part of our upcoming releases.

Follow us: mail - Twitter - Slack

Sourcetrail 2020.2

Update to LLVM/Clang 10, Python indexer updates, revised Linux Tarball package and some fixes and usability improvements. Continue reading

Sourcetrail 2020.1

Published on March 31, 2020

Sourcetrail is now free and open-source software

Published on November 18, 2019