Since the code visualization tool called Sourcetrail has become open source, I will try it immediately. It looks interesting.
@ IT's article (Code visualization tool "Sourcetrail" for C ++ and Python is open source)
Sourcetrail combines features such as interactive dependency graphs, concise code views, and efficient code search to provide source code overview and detailed information.
By statically analyzing and visualizing the source code, developers are freed from reading a huge amount of existing source code. Sourcetrail supports C, C ++, Java, Python, etc., and seems to be able to connect with editors and IDEs such as Atom, Eclipse and VS Code.
Try to set up in the following environment.
--You can download it from here (https://github.com/CoatiSoftware/Sourcetrail/releases). This time, select "Sourcetrail_2019_4_61_macOS_64bit.zip". --Unzip the downloaded zip, copy Sourcetrail.app inside to the application folder, and you're done.
I will start it immediately.
--Creating a project
You can create a new project with Command + N.
item | Input value |
---|---|
Sourcetail Project Name | Enter any project name. |
Sourcetail Project Location | Specify the save destination of the Sourcetail project file. |
--Selecting Source Group
If you click "Add Source Group" in General, the following window will be displayed.
Python has only "Empty Python Source Group", so select this and click the "Next" button.
--Source Group settings
When you click the "Next" button in the New Source Group, the following setting window will be displayed.
item | Input value |
---|---|
Python Environment | Enter the full Python path. |
Files & Directories to index | Specify the full path of the directory for source code analysis this time. |
Excluded Files & Directory | You can probably specify an excluded folder. (I haven't tried it, so I don't know the details ...) |
Source File Extensions | I'm not sure, so I'm through. |
When you click the "Next" button in the Source Group settings window, the following window will be displayed. Click "Create" to complete the project creation.
The following display will appear, so click "Start".
... This time, I tried it and it was only one file, so it ended in an instant. Click "Quit" to see the result.
(Although it is a lonely display) It seems that it was successful for the time being.
Now that the Sourcetail setup has been successful for the time being, the next step is to configure the VS Code side.
--Installation of extension
Search for "source trail" in Extensions and install the extension.
--Change settings
Open the settings with command +,, search for "sourcetrail", and set "Sourcetrail: Start Server At Startup" to True.
Official documentation (https://www.sourcetrail.com/documentation/)
The communication between Sourcetrail and the code editor is achieved using a local TCP connection. Sourcetrail uses the port 6667 to listen for incoming messages. Outgoing messages will be sent to the port 6666.
Both Sourcetrail and VS Code will be closed once and restarted.
The connection is complete when the following display appears at the bottom right of each. Thank you for your hard work.
App | display |
---|---|
Sourcetrail | Connected to VS Code |
VSCode | ☑︎Sourcetrail |
Source trail → VS Code is Command + left Click, VS Code → Source trail is right Click → "Source trail: Send Location" to connect to each.
Very convenient. (Small feeling) This time we introduced the setup on macOS, but we were able to install it smoothly on Windows 10.
-@ IT's article (Code visualization tool "Sourcetrail" for C ++ and Python is open source )
-Official documentation (https://www.sourcetrail.com/documentation/)
Recommended Posts