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

Cannot seem to watch files outside of VS Code workspace directory #418

Open
fquinner opened this issue Jul 21, 2023 · 3 comments
Open

Cannot seem to watch files outside of VS Code workspace directory #418

fquinner opened this issue Jul 21, 2023 · 3 comments
Milestone

Comments

@fquinner
Copy link

Describe the bug
Watch does not seem to work with files outside of vscode directory. In C / C++, it's common to build projects outside of the workspace to keep the workspace clean and avoid bleeding over the codebase. However when you generate a build there, the watcher does not seem to pick up changes.

Note the initial parsing actually works fine, but it does not refresh.

To Reproduce
Steps to reproduce the behaviour:

  1. Run VS Code Dev Container
  2. Fire up coverage with coverage-gutters.manualCoverageFilePaths: [ "/path/to/filesystem/lcov.info" ]
  3. Click on watch
  4. Modify the filesystem file

Expected behaviour
Updated file should be refreshed.

Desktop (please complete the following information):

  • OS: [Ubuntu 20.04 Docker Container (from windows)]
  • Extension Version [2.11.0]
  • VSCode Version [1.80.1]

Additional context
There generally seems to be some funnies in this area. I'm not a JS guy, but I also noticed that if I run with

    "coverage-gutters.coverageFileNames": [
        "lcov.info"
    ],
    "coverage-gutters.coverageBaseDir": "",

Then watch doesn't work either. Again, initial search might work but watch doesn't, it finds {/workspaces/project-dir}//{lcov.info}

Now I don't know about the GlobPattern in use here from the vscode libs, but if that was a bash glob, that would expand out to literal curly braces unless there was more than one element listed.

@mattseddon
Copy link
Collaborator

In order to watch files outside of the workspace we need to use a RelativePattern, see https://github.com/microsoft/vscode/blob/main/src/vscode-dts/vscode.d.ts#L12375 for some more details. I think this change was introduced around Jan 2022.

@ryanluker we do this in vscode-dvc using the pattern shown in this file: https://github.com/iterative/vscode-dvc/blob/main/extension/src/fileSystem/relativePattern.ts

Hope that helps.

@ryanluker
Copy link
Owner

@fquinner Thanks for the ticket! We will have to triage this work against the other in the next milestone.

@mattseddon Thanks for responding and providing that input, I bet there wasn't a feature like this when the extension was first built heh 😅 .

@ryanluker ryanluker added this to the 2.12.0 milestone Jul 30, 2023
@ryanluker ryanluker modified the milestones: 2.12.0, 2.13.0 Oct 19, 2024
@celestialorb
Copy link

I'm experiencing the same issue. My organization uses Bazel, which produces a coverage report within the Bazel cache and is thus kept out of the repository, but is accessible via a symlink from the root of the repository of bazel-out. Manually rerunning the Coverage Gutters: Display Coverage command works, but using the Coverage Gutters: Watch command does not.

From some limited testing it seems that it simply doesn't detect when the file is modified and thus doesn't reload the coverage data.

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

4 participants