question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Ensure unique filenames in FileInfo

See original GitHub issue

Type 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:

Screenshot from 2021-03-16 11-13-10

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:open
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
itviewercommented, Mar 26, 2021

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 :

20210326104238

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?

1reaction
itviewercommented, Mar 25, 2021

@ekiwi The following situations also need to be considered

scala/core/Alu.scala
test/scala/core/Alu.scala

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)

20210325145059

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ensure that filenames are unique - Obsidian Forum
I am trying to achieve that by consciously creating unique names ( ZK prefix), ... Ensure unique filename in a vault Feature requests....
Read more >
How would you make a unique filename by adding a number?
I would like the method to give me a new FileInfo with C:\file 1.ext if C:\file.ext existed, and C:\file 2.ext if C:\file 1.ext...
Read more >
FileInfo Class (System.IO) - Microsoft Learn
Provides properties and instance methods for the creation, copying, deletion, moving, and opening of files, and aids in the creation of FileStream objects....
Read more >
Set initial files with name instead of source · Issue #284 - GitHub
Hi! I load already stored images with filepond described like here. ... and I don't want that filepond shows the source as filename...
Read more >
file.info: Extract File Information - Rdrr.io
Value. For file.info , data frame with row names the file names and columns. size. double: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found