Product and Version [VS/VSCode]: VSCode
OS Version [macOS/Windows]: macOS
Live Share Extension Version: 0.3.735
Target Platform or Language [e.g. Node.js]: MacOS for the language Go
Scenario:
Any files that are inside of .gitignore does not show in the file explorer on the left.
Steps to Reproduce:
.gitignore file ignoring / hiding directories and files. Include a file with a valid public / exported Go method (with a documentation comment).gitignore show in the explorer@jpopadak, this is by design: any files matched by .gitignore are automatically _hidden_ from the guest file tree. As you point out, code and language services may still reference the hidden files. And guests can even open hidden files by means other than the file explorer, such as following the host, go-to-definition, step-into in a debugging session, find text results, or go-to-file.
If you want to change this behavior, you can add a .vsls.json file to the project and specify a value for the "gitignore" setting:
none - .gitignore contents are visible to guests in the file tree (assuming they are not filtered by a guest editor setting).hide - The default. Globs inside .gitignore are hidden from the guest file tree but accessible to guests in other ways.exclude - Globs inside .gitignore cannot be accessed by guests in any way.For more details refer to the reference doc: https://docs.microsoft.com/en-us/visualstudio/liveshare/reference/security#controlling-file-access-and-visibility
Thank you for this information, very detailed.
I looked through the documentation, but I apparently missed this entire section...
Thanks again!
@jpopadak Does this always require its own JSON file to configure? There's roughly 30 settings for live share that can be modified directly in VS Code's own settings file(s).
Most helpful comment
@jpopadak, this is by design: any files matched by
.gitignoreare automatically _hidden_ from the guest file tree. As you point out, code and language services may still reference the hidden files. And guests can even open hidden files by means other than the file explorer, such as following the host, go-to-definition, step-into in a debugging session, find text results, or go-to-file.If you want to change this behavior, you can add a
.vsls.jsonfile to the project and specify a value for the "gitignore" setting:none-.gitignorecontents are visible to guests in the file tree (assuming they are not filtered by a guest editor setting).hide- The default. Globs inside.gitignoreare hidden from the guest file tree but accessible to guests in other ways.exclude- Globs inside.gitignorecannot be accessed by guests in any way.For more details refer to the reference doc: https://docs.microsoft.com/en-us/visualstudio/liveshare/reference/security#controlling-file-access-and-visibility