go-task / vscode-task

Task for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=task.vscode-task
MIT License
36 stars 4 forks source link

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

Open saperant opened 8 months ago

saperant commented 8 months ago

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).

nights99 commented 7 months ago

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.

danielloader commented 7 months ago

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.

bdmorin commented 2 months ago

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.