Continue Discussion 19 replies
March 2021

eguiraud

Many thanks to Alberto for his amazing work on a ROOT file viewer for VS Code :partying_face: I know a few ROOT developers that are already using it :grimacing: Read all about it here or in the original post on our website.

March 2021

Wile_E_Coyote

For me, there are two problems with the new toy.

  1. When VS Code works in one of the “SSH TARGETS” in the “Remote Explorer”, it doesn’t seem to be able to browse remote ROOT files at all (well, at least I wasn’t able to get it working).

  2. It is only well suited for simple / flat ntuples which use ordinary C++ data types. It does not really understand C++ classes, including ROOT’s own classes, so it “flattens” all available data. Assume that you have a “TTree” which keeps some “objects”. Take a simple “TVector3” and all three coordinates are mixed together (and there is no way to draw, e.g., the “X()” or the “Mag()”).

Well, ROOT provides a standalone tool (needs the python feature): rootbrowse
Without python, you can simply execute (e.g., create a shell alias): root -e "TBrowser b"
Of course, you do need a working ROOT binary distribution for them … but if you work on ROOT related source code, you anyhow must have it on your “target machine”.
These standard ROOT executables do understand all standard ROOT classes, and if your ROOT files use some nonstandard ones, you can simply load the corresponding shared libraries to be able to inspect them.

1 reply
March 2021 ▶ Wile_E_Coyote

bellenot

You need to install ROOT to use rootbrowse, while you don’t need ROOT to use the VS Code plugin…

March 2021

Axel

Yeah this is more: say I’m coding my analysis, need to enter that branch name, what was that again? And here, thanks to this plugin, it’s all part of the IDE: I can browse ROOT files, trees, see histograms, and adjust the code appropriately. That’s the beauty! :slight_smile:

March 2021

enpg_qz

Excellent job, thanks!

March 2021

xtovo

Nice!
I’m trying to build it from github sources
… but node_modules dir is missing :frowning:
Is it OK? (I’m newbie with VScode extensions)

March 2021

AlbertoPdRF

Hey!

First of all, thanks everyone for the kind words! The support that the extension has received so far has been awesome :star_struck:

@xtovo: how are you trying to build it? After clonning the repository, running yarn && yarn run compile from the base folder should do it. Feel free to reach out to me if you have problems or something is not clear enough!

March 2021

xtovo

Thanks. It’s OK.
I found “vscode:prepublish”: “yarn run compile” in package.json

I’m newbie with VScode extensions and on the learning curve.

1 reply
March 2021 ▶ xtovo

AlbertoPdRF

I just added the basic instructions to build and run the extension locally to the README, please check it out at GitHub - AlbertoPdRF/root-file-viewer: View ROOT files directly in VS Code!

The node_modules folder contains all the dependencies of a given project – there’s no need for these dependencies to get installed globally. Of course, this means that you can have several installations of the same library on your system, but this way it’s ensured that you always have the correct version of each one installed for each project. As you point out, these folders can grow huge, so a good practice (IMHO) is to delete them when you are not working on a project anymore, as installing all the dependencies again is quite straight forward if you need to

March 2021

xtovo

Thanks.
Is it possible to extend this extension to run ROOT macro from inside VS code?
See the following scenario:

ROOT allows to set breakpoints inside a macro and step-by-step execution,
so it would be good to add key bindings:

I also want to have possibility compile, compile&execute macro.

1 reply