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

osx: Display not automatically updated when watch is activated and coverage file is a symlink #186

Closed
SimonKagstrom opened this issue Nov 8, 2018 · 7 comments

Comments

@SimonKagstrom
Copy link

SimonKagstrom commented Nov 8, 2018

I'm running on OSX, with a symlink to the coverage file in my workspace (Cobertura format).

Watching is turned on, but when I update the coverage file through re-running my unit tests, the update coverage is not shown in the gutter. If I select Coverage gutters: Display coverage it's updated correctly again.

OS: macos
Extension version: 2.2.1
VSCode version: 1.28

I also run the same project in the same way in Linux, where it seems to work. update: It might be because of the symlink, which I suppose is reasonable.

@SimonKagstrom SimonKagstrom changed the title osx: Display not automatically updated when watch is activated osx: Display not automatically updated when watch is activated and coverage file is a symlink Nov 9, 2018
@ryanluker
Copy link
Owner

@SimonKagstrom thanks for submitting an issue, I use the vscode extension api file watchers [0] so we would have to investigate if those detect sim link file changes or not 🤔 .

[0] https://code.visualstudio.com/docs/extensionAPI/vscode-api#FileSystemWatcher

@SimonKagstrom
Copy link
Author

If there is an API to dereference symlinks to find the real path, I think the watch should be set there instead.

The reason I use this is because of #184, where I simply symlink cobertura.xml -> cov.xml.

@ryanluker
Copy link
Owner

ryanluker commented Nov 18, 2018

@SimonKagstrom I am not sure you need to symlink anymore if you add your cobertura.xml file name to the new extension setting I added recently https://github.com/ryanluker/vscode-coverage-gutters/blob/master/package.json#L127-L135 . Let me know if that ends up working for you.

@SimonKagstrom
Copy link
Author

Yes, that works. Am I supposed to edit the package.json file directly or is there some better way of configuring this?

@ryanluker
Copy link
Owner

@SimonKagstrom I have included a gif below of how to do this but essentially what you do is go into your settings.json for vscode and modify the filenames attribute (make sure to open and close vscode to get these settings to be picked up).

screencast-from-2018-11-25-09_22_54-am

@SimonKagstrom
Copy link
Author

SimonKagstrom commented Nov 26, 2018

Thanks a lot for explaining via an example!

Anyway, the symlink is also useful when the coverage output is placed outside of the repo (which I guess is pretty common). I typically place the output in /tmp/kcov, and then a symlink would also be needed.

I'll consider writing cov.xml from kcov as well, since it's nice to have it work out-of-the-box without having to configure anything.

@ryanluker
Copy link
Owner

@SimonKagstrom with the new upcoming option to pick file paths (to individual coverage files) I am going to close this ticket. Thanks for bringing it up though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants