codecharta
codecharta copied to clipboard
Link cc.json to the source code
Feature request
Currently it's hard to check out the SourceCode of an interesting building. Suppose I find a building which I want to evaluate qualitatively. I first have to remember the complete path (*Service.java classes are probably in all the packages) and then open that file in my editor of choice.
If I have generated my cc.json from Sonar, every building has an url which I can open by double-clicking the building. While that is a great solution for many cases, it has problems when Sonar is no longer available. We could have created a temporary Sonar instance just for code analyis. Or the Sonar is only accessible from certain VPNs. And even if Sonar is available, the web code view is not great for exploring a codebase. I cannot jump to definiton and other IDE features.
Description
If CodeCharta knows the source code location, a double-click on a building "foo/Bar.js" in the desktop Version of CodeCharta should do the equivalent of open foo/Bar.js
. Supplying the source code is done in the Desktop version when loading new maps. This has to work even when loading multiple maps.
We won't store the link in the cc.json for now and wait for user feedback.
Linking
When I load one or multiple maps Then a modal opens that allows me to pick the source code location for each cc.json and this model has the same style as the file export model.
When I have linked cc.jsons to their source code Then a small code icon to the right of the cc.json name shows me code was linked. We can show this inside the file dropdown.
Behavior
Given a map has been linked to its source code When I double-click the building Then the default editor opens that shows me the source code
Given a map has been linked to its source code and I have selected a building When I look at the file attribute bar Then I can see a clickable Open button directly under the url attribute
Given a map has NOT been linked to its source code When I double-click a building and the building has an url field Then my default browser opens the url
The scope should be changed a tiny bit: let's validate a url before opening. If it's invalid, let's ask the user about the current directory of the repository or for a new link to the code. All links are then updated accordingly.
There is a new API with which it's possible to implement this in the browser 🎉.
https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API#specifications