Sourcetrail 2018.1

Author: Eberhard Gräther

With the Sourcetrail 2018.1 release we mostly focused our efforts on fixing known issues, polishing UI style and adding smaller usability features that we didn’t get around to implement so far. The new release runs more stable, looks nicer and does a better job in providing you the information you need when exploring C, C++ and Java source code.

Sourcetrail's user interface for exploring C, C++ and Java source code.

New in this Release:

  • UI Style: Style for view title bars, scroll bars and view separators; screen scaling options for Linux
  • Indexer: Refresh incomplete files mode; show indexing progress in Windows task bar; flag to deactivate Source Groups
  • Code View: Keep title bar and scroll bar visible in snippet mode; maximize button switches to single file view
  • Graph View: Hide nodes and edges on demand; hide built-in types by default; improved image export
  • C++: Improved template variable and parameter detection; added include path detection to project setup
  • Java: support .aar files; better exception handling
  • Windows Portable Package: Currently available in the extra downloads section
  • Lots of crash and bug fixes!

You can download Sourcetrail 2018.1 here. The full changelog is available here. We will outline the most important features new to this release below.

UI Style

Style for Title Bars, Scroll Bars and View Separators

One of the major goals for this release was further unification of the UI style between the different platforms, as well as better look of the dark color schemes by replacing bright standard UI.

To achieve this, custom styles have been introduced for scroll bars, title bars and view separators. These changes especially affect the Windows and Linux platforms. Have a look at the window comparison below!

Before and after comparison of Sourcetrail's UI style on Manjaro Linux using the dark color scheme.

Screen Scaling Options for Linux

There have been several reports of scaling issues on Linux systems when Sourcetrail was used on high-DPI screens over the past months. Some UI elements such as texts, buttons or icons appeared too small and the whole UI had an inconsistent look.

We fixed these issues for most Linux systems by enabling the Qt attribute Qt::AA_EnableHighDpiScaling. But for some systems this resulted in the opposite effect and caused before mentioned issues instead. After some testing it turned out that this issue is not resolvable via automatic detection. We decided to add settings to Sourcetrail’s preferences for manually defining the screen scaling behaviour.

New Screen Scaling settings in Sourcetrail's Preferences on Linux.

In the background these settings manipulate the environment variables QT_AUTO_SCREEN_SCALE_FACTOR and QT_SCALE_FACTOR. If the UI looks wrong on your Linux system, please try to disable Auto Scaling to DPI, which should resolve the issues in most cases. You will need to restart Sourcetrail for these changes to take effect.

Indexer

Refresh Incomplete Files Mode

So far we only offered two ways of indexing the project: either the whole project or all updated + depending files. Now we added a third mode that allows you to reindex all incomplete files (files with errors) as well.

This new indexing mode will save you time while fixing errors in your project setup. So far you had to reindex the whole project when changing project settings e.g. Compiler Flags, even though the change wouldn’t affect already correctly indexed files. Now you can choose to just update Incomplete & updated files, so all files that were already indexed with no errors, won’t have to be indexed again.

Radio button selection for indexing mode on Start Indexing Dialog.

Indexing Progress in Windows Task Bar

Sourcetrail makes use of the Windows Task Bar API now, which allows us to display the current indexing progress of Sourcetrail in the task bar. This way you are informed about the current indexing progress without constantly having to check it yourself.

Indexing progress shown in the Windows task bar.

Deactivate Source Groups for Indexing

Your Sourcetrail project might be separated into Source Groups, one for each package, module, library or test suite. We added a Status checkbox to each Source Group, which allows you to deactivate this Source Group and remove it from the index. This new setting allows you to disable certain parts of your codebase, if you are currently not interested in seeing them.

You need to reindex the project for this setting to take effect.

New Status checkbox allows to deactivate Source Groups from indexing.

Code View

Keep File Title Bar and Scroll Bar visible in Snippets View

With this release we also fix two big usability issues in the Snippets View of the Code Window. So far the title bar of the snippet went out of view when scrolling down. Now the title bar of the top snippet will always stick to the top of the view.

The same problem existed with the scroll bar of the bottom snippet. If the snippet had a horizontal scroll bar it was only visible at the bottom of the snippet. Now it will always be available at the bottom of the view.

Title bar at top and scroll bar at bottom stay visible even when snippet is cut off.

Maximize Button of Snippets now switches to Single File View

While the Snippet View of the Code Window was always great for showing all locations of a symbol at once, it was cumbersome when inspecting whole source files. For this use-case we added the Single File View. So far the only method of switching between these modes was via the two buttons in the upper right corner of the Code Window.

From now on, switching between Snippets and Single File View is also possible via the buttons in the File Title Bar.

Switch between Snippets and Single File mode via Title Bar buttons now.

Graph View

Hide Nodes and Edges

Sourcetrail shows all connections of a node by default in the Graph View. However, some users noted that it would be nice if nodes could be removed when they are of no interest or when they shouldn’t be visible on an exported graph image. With the new release we added a feature to hide nodes and edges from the graph via a Context Menu action or by using the Alt + Left Click shortcut.

Hide nodes from the graph using the context menu or 'Alt + Left Click' shortcut.

Hide Built-in Types by Default

Built-in types such as int or bool used to be shown by default in the Graph View, but some users noted that it’s not important to see these connections. Having them shown just clutters the graph diagram. With this release we removed built-in types from the Graph by default, but also added a UI setting to the preferences for showing them again, if this is your preferred behaviour.

C++

Improved Template Variable and Template Parameter Detection

The new release also contains improvements to our C++ template analysis, by adding more previously not present edges. A couple of weeks ago I also made a video about how Sourcetrail can help you when exploring C++ template specializations in your source code. Watch the video to find out more!

 

Our new video on exploring C++ template specializations.

 

Added Include Path Detection to Project Setup

With the new auto-detect button at the Include Paths setting, we now provide another helper feature for making project setup of C/C++ projects easier. Sourcetrail can now automatically search for header files in a provided list of directories and produce a list of Include Paths.

Just add all directories that contain header files, such as your own project directories and third-party directories and start the detection. Use the validate include directives button to check whether there are still missing include paths afterwards.

'auto-detect' and 'validate include directives' buttons at the C/C++ Include Paths setting.

Closing comments

Thanks for reading! Please share if you like our progress and don’t forget to download the new release build.

Follow us: mail - Twitter - Facebook - Google+

Sourcetrail 2018.4

Big indexing performance improvements, reduced memory consumption, new tabs bar to open multiple symbols simultaneously and more type-use edges for templates/generics. Continue reading

Sourcetrail 2018.3

Published on August 06, 2018

Const - Friend or Foe in C++?

Published on June 04, 2018