-
Notifications
You must be signed in to change notification settings - Fork 88
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
Ability to read relative paths? #29
Comments
I dont see why the lcov compare couldnt have a relative option (compare equality based on file name rather then file path as it is now). I will add this to the 0.3.0 milestone and see if I can flesh something out 😄 . Thanks for the feedback! |
Just to be sure I'm clear, I'm speaking about the SF values of the LCOV file. The current approach in my node/Typescript project is to generate on the server, after a project build, the Javascript LCOV file (with Istanbul and Mocha) and then to use Istanbul-remap to generate the Typescript LCOV file from the Javascript LCOV one and the source mapping. But if Istanbul creates SF absolute paths, Remap-Istanbul creates SF relative paths... Which would be perfect for my needs, but isn't handled by the VS Code Coverage extension and led me to these threads:
In geninfo man page:
Well, not sure if the part describing LCOV files can really be considered as a spec. But I was wondering if SF being absolute should really be the case and if there's some reason why no VS Code coverage extension handles project-relative SF paths, which would be more portable than absolute ones (and would save me some transformation scripts). Maybe potential issues I didn't think of? |
Thanks for the extra info. I was planning on modifying / applying a configurable flag to the section around https://github.com/ryanluker/vscode-coverage-gutters/blob/master/src/gutters.ts#L95 that would turn on fuzzy file matching rather then the absolute version there is now. This fuzzy matching could be glob or regex based (or simply just the filename maybe). |
I didn't see any line 95 in your source file... ;) I didn't debug the code (or code VS extensions), I don't know at my level what "window.activeTextEditor.document.fileName" returns, but I guess that's a file with its absolute path, and get the issue now. If I follow correctly, the SF filename I was speaking about is the BTW your code is clear and concise, it's tempting to come contribute once I'll have more time... |
Yah line 95 went away when I refactored the gutters class to be more testable in a recent release 😄 . Thanks for the extra insight as well into the possible solutions, I will see about tinkering up a PR with a workable fixing sometime in the near future! Side note, I managed to recreate this with bash for windows generating my lcov and then vscode consuming it from my C drive.
As you can see mnt/c/dev would never match C:\dev! Thanks for the heads up on this @tomitm . |
Another use case :) |
@ndegardin I have a workable solution up in a pull request here #33 vscode-coverage-gutters/src/indicators.ts Line 58 in 3479753
backed by the test cases outlined here:
I made this option default to false for now but ideally next release you would be able to activate this feature 😄 . Looking forward to your feedback! |
And to share: It runs on server/container side, once the compilation is done (by watching some build info file). Hence the importance for me of portable paths and of a coverage that can be refreshed on each build.
Maybe there's a simpler way, I didn't have too much time to dig... |
The way you are doing it makes sense seeming you need to have the server -> client option work, I cant see any simpler way from a high level. Side note, I created a release tonight with a few bug fixes and the relative path fix. When you get a chance to update let me know if the issue is still resolved. The option, altSfCompare, is false by default so make sure you change that to true and open / close the IDE to have the config load properly! |
Updated to 0.2.1, it's still working great with relative paths. |
A quick question: is it possible to use relative file paths in the LCOV file?
I didn't find any VS Code coverage extension allowing for relative paths, and I'm desperately looking for that, for my development tools to be completely on the server/container side.
The text was updated successfully, but these errors were encountered: