Feature Request: Ensure unique filenames in FileInfo
See original GitHub issueType of issue: feature request
Development Phase: request
Other information
Currently the FileInfo
that we produce only includes the name of the scala file without any path info. This is great if there is only a single file with this name. However, once there is more than one file with the same name in the code base, it is no longer possible to automatically jump to the correct scala file.
As an example, let’s say we have the following files:
src/core/Alu.scala
src/accelerator/Alu.scala
src/accelerator/TensorAlu.scala
Currently we would get Alu.scala
for lines from both files of this name.
I would like to suggest, that we selectively add path information until we get a unique name for each file.
So in this case we would use the following names in the FileInfo
: core/Alu.scala
, accelerator/Alu.scala
, TensorAlu.scala
.
This way of distinguishing filenames is similar to what IntelliJ does:
I think this would be a nice compromise which would help us distinguish files with the same name, but still retain the human readable FileInfo
with minimal changes.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top GitHub Comments
I think we need a flag or parameter to identify whether it is in coverage report mode when testing. If it is, SourceInfo should give the absolute or relative path of the file, similar to https://github.com/chipsalliance/chisel3/pull/1517 mentioned by @sequencer. If it is not, it is better to keep only the file name, otherwise, FileInfo information is somewhat redundant.
For the Line Coverage Report, one of my thoughts is that the Coverage Report may not need to include the Scala Source code, just include the source file path. The plugin or editor can analyze the report results and display it in conjunction with the source code. Like the Git diff view :
I plan to package Chisel related packages with the IntelliJ plugin together after Chisel 3.5 is released, so that we can do a lot of things with plugins, such as code analysis, code generation, … or any good ideas?
@ekiwi The following situations also need to be considered
I suggest to provide a file list for the user to choose which file to jump to. If you use easysoc-firrtl plugin, I have added this feature and uploaded the new version to the Intellij plugin store. (It may take a day for the update to be available, before the plugin is approved, you can manually download and install it)