Skip to content

VS Code Support, master branch (2019.11.27.)

This is a "fun" MR, which I think many people in the Core SW group will enjoy. 😄 So let me tag a few people... @tsulaia, @ssnyder, @fwinkl, @leggett.

The MR makes it possible to use Visual Studio Code with the WorkDir project a bit more conveniently.

In order for VS Code to parse our code correctly, it has to be told explicitly how each source file needs to be compiled. (Otherwise it would not find the headers from LCG/TDAQ/Gaudi to interpret our code.) This update makes sure that when the user sets up the build of the WorkDir project in the "usual layout" (in a directory called build/ just beside the athena/ directory), VS Code would automatically find the correct compile_commands.json file that it needs when the user opens the athena/ directory for editing.

Resulting in an editing experience like:

Screenshot_2019-11-27_at_10.00.17

Unfortunately this thing only works with partial builds at the moment, it doesn't work with partial checkouts. We would have to ask @karolos to include the .vscode directory in partial checkouts (if it exists). Unfortunately I didn't find an easy way of telling git-atlas to check it out for me. 😦

The way I did the previous thing was:

git clone ...
mkdir build
cd build/
cmake -DATLAS_PACKAGE_FILTER_FILE=../package_filter.txt ../athena/Projects/WorkDir/
code

I.e. it's important to start VS Code from the same environment in which the build is to be performed. (Since the configuration I added in this MR makes use of the ${CXX} environment variable.)

P.S. It of course doesn't work on lxplus. At least not until they install VS Code on the lxplus machines. But on private CentOS 7 machines, that have VS Code installed, it works very nicely. 😉

Merge request reports