Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Koverage showing absolute file path in explorer. #2

Closed
TheDudeFromCI opened this issue May 16, 2020 · 9 comments
Closed

Koverage showing absolute file path in explorer. #2

TheDudeFromCI opened this issue May 16, 2020 · 9 comments
Labels
bug Something isn't working

Comments

@TheDudeFromCI
Copy link

It seems for some reason the explorer is showing my entire file path in the explorer instead of just the relative. It also fails to open them as a result. (i.e. ``cannot open '/home/thedudefromci/workspace//home/thedudefromci/workspace/file'`)

My settings, defined in .code-workspace file:

"koverage.coverageFileNames": ["coverage.info"],
"koverage.coverageFilePaths": ["Tests"]

Also worth noting that coverage.info is an lcov file type.

koverage

@tenninebt
Copy link
Owner

Any chance I can get the lcov file? It could help me investigate. Also, the actual full path to TextureAtlas.cs, just to understand the real hierarchy versus the explorer hierarchy. Last question, are you using it in macos or windows? Because for now I tested it only on macOS.

FYI, to easily handle the multi-folder workspaces, I had to open the files using their full paths. I can have a look at changing that but first, I would rather fix it using full paths which will probably be quicker.

@tenninebt tenninebt added the bug Something isn't working label May 16, 2020
@TheDudeFromCI
Copy link
Author

Sure, here you go.

The absolute path of the file is:
/home/thedudefromci/Documents/workspace/Bones3-Core/Core/Source/Textures/TextureAtlas.cs

My operating system is actually Linux. (Specifically Fedora 32)

@tenninebt
Copy link
Owner

I see what's happening, don't know how to fix that yet. In my test environment (Flutter/Dart) the lcov had relative path while in your lcov, the paths are absolute.
I will have a look soon on how to fix this. (It it going to be easy to fix it for full paths, but I'm seeing another potential bug for relative paths, they could be different according to the environment/tech used, could be relative to the workspace, to the source root... Maybe it should just be a configuration)

@TheDudeFromCI
Copy link
Author

TheDudeFromCI commented May 16, 2020

Could you truncate the paths when loading them? Absolute paths always start with a prefix, c:/ (or any other letter) on Windows or / on Mac and Linux. When loading the file, if the paths don't have that prefix, simply manually append the file path to the root folder. Either that or clip off the absolute paths to turn them into relative ones.

@tenninebt
Copy link
Owner

tenninebt commented May 16, 2020

Actually, there is an easy way to check if the path is relative or absolute.
But it is probably easier to just truncate the path of the workspace from the file path (The file path is used to build the hierarchy, and that explains why the tree is broken).
The thing is for the lcov with relative paths, I don't know right now if they always start at the workspace folder root. I will consider it is the case until proved proved otherwise.

@TheDudeFromCI
Copy link
Author

As far as I know, LCov is allowed to use either option. While extremely uncommon, it's also technically possible to use both in the same file.

@tenninebt
Copy link
Owner

I pushed a fix, could you get the 0.0.3-dev and test it please?

@TheDudeFromCI
Copy link
Author

It's working now, yes. Everything appears to be working as expected. I can also open files and all that, now. Success!

@tenninebt
Copy link
Owner

Fixed by aacbeb7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants