vscode-task icon indicating copy to clipboard operation
vscode-task copied to clipboard

Ignoring taskfile: "..." (outside of workspace)

Open saperant opened this issue 2 years ago • 6 comments

It seems that the following check causes problems, when VS Code project is opened behind a symlinked folder: https://github.com/go-task/vscode-task/blob/8f857660326255281fcdbf6bb4c24850970612f3/src/services/taskfile.ts#L206C25-L206C25

Had this error message:

Updating settings
Extension activated
Calling GitHub to get the latest version
Searching for taskfile in: "/home/saku/src/myproject"
Ignoring taskfile: "/home/saku/src/myproject/Taskfile.yml" (outside of workspace)

And everything is working fine when there is no symlink in the project path (my ~/src is a symlink).

saperant avatar Dec 07 '23 20:12 saperant

I'm also hitting this; it might be sufficient to call fs.realpathSync() on the workspace dir? I'm a long way from an expert in this area, but I've tried that and it seems to work for my case at least.

nights99 avatar Dec 31 '23 17:12 nights99

I have this issue but no symlinks involved, just trying to open both the local repo specific Taskfile.yml and my global user Taskfile.yml in the $HOME.

I imagine the extension just can't access files outside of the workspace directory for sandbox/security reasons. This might have been a recent change to vscode if this used to work.

danielloader avatar Jan 03 '24 13:01 danielloader

I just started using task, and cannot get the extension to use Taskfile.yml in my vscode. I keep getting the same message @saperant does, but I have no symlinks.

Detected changes to taskfile
Searching for taskfile in: "/Users/bdmorin/src/deploy"
Ignoring taskfile: "/Users/bdmorin/src/deploy/Taskfile.yml" (outside of workspace)

The directory is in my trusted zones.

bdmorin avatar May 30 '24 19:05 bdmorin

Same issue - Taskfile.yml and the task executable are located within the project.

vscode output panel for Task(Debug):

Searching for taskfile in: "/home/theuser/projects/project"
Ignoring taskfile: "/data/home/theuser/projects/project/Taskfile.yml" (outside of workspace)

project directory structure:

.
├── .envrc
├── .gitignore
├── .vscode
│   └── settings.json
├── LICENSE
├── README.md
├── Taskfile.yml

content of .vscode/settings.json: Also unexpected that it is necessary to fill in the command name of task instead of the path. In case of a devbox.sh environment, the task executable would be located at .devbox/nix/profile/default/bin/task.

{
    "task": {
        "path": "task"
    },
}

dvgitit avatar Feb 28 '25 10:02 dvgitit