Ericsson / CodeCompass

CodeCompass is a software comprehension tool for large scale software written in C/C++ and Java
https://codecompass.net
GNU General Public License v3.0
517 stars 101 forks source link

Make labels dynamic on New Frontend #613

Closed mcserep closed 1 year ago

mcserep commented 1 year ago

When parsing a project, users can define arbitrary labels (e.g. source). They can also be added later through the project_info.json file from each project. Currently the New Frontend has a hardcoded "Jump to source" label, instead of dynamically reading and displaying all labels. (Which even displayed and does not work, when there is no source label at all.)

mdeme01 commented 1 year ago

Are all labels used to jump to a directory in the file manager? (Also, I thought that the source label is mandatory, because it is required for the git blame to work.)

mcserep commented 1 year ago

When executing CodeCompass_parser, you may mark any subdirectory as a label by adding it with a --label labelname=/path/to/folder flag.

These are then stored in the project_info.json file in the workspace directory and can be also edited adterwards, if needed.

The source label is not mandatory. Why do you think it is required for the git blame view? Git repositories are detected by the parser by the presence of the .git folder through an iterative directory walk, and not by the labels. A project can even contain multiple Git repositories and then the git plugin will parse all of them. The metadata of the found git repositories are persisted in the workspace folder.

Message ID: @.***>

mdeme01 commented 1 year ago

I thought you needed the path to the source directory for getting the blame info, but I just found out that there is a repoPath property you can use, I fixed it. Thanks for clarifying.

I fixed this here. I will create a PR once I fixed most of the issues.