Sourcetrail 2017.3

Author: Eberhard Gräther

Sourcetrail 2017.3 offers a lot of UI refinements, performance improvements and bug fixes. However, it also holds a few long awaited features, like interactive tooltips with information about variable types and signatures, a command line API for reindexing, as well as an automatic update checker.

You can download Sourcetrail 2017.3 here. The full changelog is available here. We will outline a few features new to this release below.

Tooltip popup box showing the signature of the constructor of ArtificialPlayer from the TicTacToe sample project.

New in this Release:

  • Interactive tooltips showing variable types and function signatures
  • Command line API for (re)indexing projects
  • Automatic update checker
  • Performance improvements of file clearing during refresh, project loading time, symbol hover latency
  • Better Java indexer coverage and performance

Interactive tooltips

As noted by some users’ feedback, this was an “obvious” missing feature. So far Sourcetrail only offered tooltips in the graph view, which only showed the symbol’s type. For functions and methods it also displayed the full signature, but only as plain text.

With this release we added a new interactive tooltip popup to graph and code view. The tooltip will appear about a second after hovering a symbol and holds information about:

  • symbol type e.g. class, function, file etc.
  • visibility e.g. public or private if applicable
  • reference count of the symbol
  • symbol name
  • clickable type name for variables
  • full signatures for functions and mothods with clickable return types and parameter types.
Showing interactive tooltips in graph and code window on mouse hover.

Due to the way signatures are currently stored in our database, the signatures don’t look exactly as declared in your source code, but use fully qualified type names like the compiler/linker use them. Parameter names are also not shown by the current implementation. We plan extend this implementation to show signatures the same way as defined in the source code in the future.

Command line API for indexing projects

We added a minimal commandline API for indexing projects and configuring indexing related preferences. First add the location of your Sourcetrail binary to your PATH environment variable so you can access it directly from the command line, e.g. on macOS the binary is located at /Applications/Sourcetrail.app/Contents/MacOS.

Run Sourcetrail from the command line with the --help or -h option to find out more about the usage:

$ Sourcetrail --help
Usage:
  Sourcetrail [command] [option...] [positional arguments]

Commands:
  config
  index

  * Each command has its own --help

Sourcetrail Options:
  -h [ --help ]          Print this help message
  -v [ --version ]       Version of Sourcetrail
  --project-file arg     Open Sourcetrail with this project (.srctrlprj)

Positional Arguments:
  1: project-file

Currently there are 2 commands, index and config. Use the index command to index a project, the --help option explains its usage:

$ Sourcetrail index --help
Usage:
  Sourcetrail index [option...]
f

Config Options:
  -h [ --help ]          Print this help message
  -f [ --full ]          Index full project (omit to only index new/changed
                         files)
  --project-file arg     Project file to index (.srctrlprj)

Positional Arguments:
  1: project-file

To index a project from the command line simply use:

$ Sourcetrail index <path/to/project.srctrlprj>

This will index a project from scratch or refresh it in case there is already a .srctrldb file present. To reindex the whole project you can add the parameter --full or -f:

$ Sourcetrail index --full <path/to/project.srctrlprj>

The config command can be used to change indexing related preferences. To see a list of all available options run:

$ Sourcetrail config --help
Usage:
  Sourcetrail config [option...]


Config Options:
  -h [ --help ]                         Print this help message
  -t [ --indexer-threads ] arg          Set the number of threads used for
                                        indexing (0 uses ideal thread count)
  -p [ --use-processes ] arg            Enable C/C++ Indexer threads to run in
                                        different processes. <true/false>
  -l [ --logging-enabled ] arg          Enable file/console logging
                                        <true/false>
  -L [ --verbose-indexer-logging-enabled ] arg
                                        Enable additional log of abstract
                                        syntax tree during the indexing.
                                        <true/false> WARNINIG Slows down
                                        indexing speed
  -j [ --jvm-path ] arg                 Path to the location of the jvm library
  -M [ --jvm-max-memory ] arg           Set the maximum amount of memory for
                                        the JVM indexer(-1 for using the JVM
                                        default settings)
  -m [ --maven-path ] arg               Path to the maven binary
  -J [ --jre-system-library-paths ] arg paths to the jars of the JRE system
                                        library. These jars can be found inside
                                        your JRE install directory (once per
                                        path or comma separated)
  -z [ --license-file ] arg             Enter license via Licensefile
  -Z [ --license-string ] arg           Enter licenes via commandline
  -g [ --global-header-search-paths ] arg
                                        Global include paths (once per path or
                                        comma separated)
  -F [ --global-framework-search-paths ] arg
                                        Global include paths (once per path or
                                        comma separated)
  -s [ --show ]                         displays all settings

To change a value use an option flag followed by the new value:

$ Sourcetrail config --logging-enabled 1

Use the --show option to see the current values for all preferences:

$ Sourcetrail config --show

Automatic update checker

With our automatic update checker Sourcetrail can finally tell you if a new version is available. The automatic update check is located on the Start Window and is disabled by default. If enabled, Sourcetrail will connect to our server at https://www.sourcetrail.com once a day to check whether a new version is available. If that is the case, a dialog informing you about the update will be shown, including a button to download the new release.

Checkbox for automatic update check on the Start Window.

You can also manually invoke the update check by clicking on check for new version above. Or just ignore these update check features and Sourcetrail won’t ever connect to our online server.

Improved Java indexing

At the moment we are working hard to improve and finalize our Java indexer coverage, which is still not as good as our C/C++ coverage. Java projects still yielded a lot of unsolved symbols. We could already reduce the percentage of unsolved symbols from 6.5% to 1.7% in our test projects with this new release and will continue to cover more unhandled cases.

Java indexing performance was also greatly improved with this release and is now about 2.5 times as fast as before. We are looking forward to ending our Java Beta with our next release version.

Closing comments

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

Follow us: mail - Twitter - Facebook - Google+

How to Export a Clang Compilation Database from a Visual Studio Solution

After taking a glimpse on the Compilation Database format this article describes the Sourcetrail Extension which lets you generate this format for any existing Visual Studio Solution. Continue reading

Sourcetrail 1.0 (2017.2)

Published on June 21, 2017

Sourcetrail 0.12

Published on May 16, 2017