npx / vscode-hide-gitignored

19 stars 7 forks source link

Hide doesn't work on workspaces #4

Open NicoCevallos opened 5 years ago

NicoCevallos commented 5 years ago

Eve though the extension adds the files to hide in the workspace settings, it doesn't work.

Using VSCode without the workspaces, the extension works perfect.

rpep commented 5 years ago

Yes, I'm also having this issue. The files seem to be greyed out but not hidden.

npx commented 5 years ago

Sorry guys, this still seems to be related to this: https://github.com/Microsoft/vscode/issues/28538

I'm using the proper APIs but they ignore folder settings for workspaces still.

You can open each of the workspace folders, run the command and then reopen your workspace. That will work, but is really inconvenient. :(

fudanglp commented 4 years ago

does work for folders automatically either. works after ctrl+shift+p -> Hide Gitignored:....

vscode ver:1.42.1 ubuntu18.04

npx commented 4 years ago

I just republished the extension upgrading the APIs and hope that now the problem is resolved. Would anyone report back to me? :)

nachovizzo commented 4 years ago

I think this might be related to excluding the ".gitignore" file itself from the workspace. The extension was not working in my case for this reason.

On my vs-code settings.json:

// blah blah
"files.exclude": {
    "**/.gitignore": true,
}

I fixed this skipping the workspace-excluded files from the findFiles call:

out/gitignore-hider.js
61:      const files = yield vscode_1.workspace.findFiles("**/.gitignore", null);
swrobel commented 4 years ago

I just republished the extension upgrading the APIs and hope that now the problem is resolved. Would anyone report back to me? :)

Unfortunately it still just seems to be graying them out in VSCode 1.44.2

cwerner commented 4 years ago

Not sure if I did something wrong - but for me the files are still present and just grayed out... I'm on VSCode 1.45.0 MacOS

DoubleD-BrewCo commented 4 years ago

I just republished the extension upgrading the APIs and hope that now the problem is resolved. Would anyone report back to me? :)

Unfortunately it still just seems to be graying them out in VSCode 1.44.2

This does work for me after applying the suggestion made by fudanglp.
vscode v1.46.1, windows 10

thanks for the extension

Viech commented 4 years ago

It seems that for a workspace with multiple root folders, the root folder prefix that your plugin adds is not respected by Code but instead each line of files.exclude is considered relative to each root folder. An excerpt from my workspace config generated by your plugin:

    "folders": [
        …
        {
            "name": "picos",
            "path": "../picos"
        }
    ],
    "settings": {
        "files.exclude": {
            …
            "picos/**/__pycache__/": true,
            …
        }
    }
}

Now picos/__pycache__ (where picos/ is the root folder) is still visible (though greyed out by Code) while the subfolders picos/picos/__pycache__ and picos/picos/expressions/__pycache__ are properly hidden.

In other words, the picos/ prefix is not treated as a root folder selector but is matched within each root folder. Unfortunately I did not find an alternative that works as desired. See also https://github.com/microsoft/vscode/issues/70438.

This is using Code OSS 1.47.0-1 on Arch Linux. The line "picos/**/__pycache__/": true, was produced from the line __pycache__/ in picos/.gitignore.

ursawd commented 4 years ago

Extension does not hide workspace file. Attached is screenshot after Hide Gitignored command run. https://gyazo.com/5bb6ce62382bc2ab341ec02a38ff319c

sunilhari commented 3 years ago

Having the same issue.