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

Allow a workspace to show individual files from other folders #45177

Open
Sneezry opened this issue Mar 7, 2018 · 139 comments
Open

Allow a workspace to show individual files from other folders #45177

Sneezry opened this issue Mar 7, 2018 · 139 comments
Labels
feature-request Request for new features or functionality keep Issues we should not close as out of scope workbench-workspace Workspace issues
Milestone

Comments

@Sneezry
Copy link
Member

Sneezry commented Mar 7, 2018

Update from @bpasero: this issue was renamed based on the discussion at the end (see #45177 (comment) and above)

Original below:

  • VSCode Version: 1.20.1
  • OS Version: Microsoft Windows [Version 10.0.16299.248]

Steps to Reproduce:

N/A

Does this issue occur when all extensions are disabled?: Yes


Currently, .code-workspace only contains folders field which allows to add folders into workspace. I prefer a way to add single files into workspace for the entire project, such as README or something else.

@bpasero bpasero added the workbench-multiroot Multi-root (multiple folders) issues label Mar 7, 2018
@bpasero bpasero changed the title [Feature Request] Allow "files" field in .code-workspace file Allow "files" field in .code-workspace file Mar 7, 2018
@bpasero bpasero added the feature-request Request for new features or functionality label Mar 7, 2018
@bpasero bpasero removed their assignment Mar 7, 2018
@TuxVinyards
Copy link

I seem to be able to add files to the 'workspace' by just using file > open. However, they don't show in the workspace side bar, so can't do things like rename when doing versioning numbers. Also 'gitlens' doesn't seem to track them either.

@TuxVinyards
Copy link

Or, to put this in different words:
I can create a workspace from a couple of folders. But if I want to add a couple of files as well, I can't get the same workability The .workspace file seems to record the files that I have open but as they don't show in the side bar ....

@OwenPattison
Copy link

I've had the same issue this week where I've altered the structure of my solution so that i only have single package.json and tsconfig.json in the root of my solution, where previously there were multiple of both package.json and tsconfig.json located inside of a corresponding 'App' folder, this meant in my workspace i could add each 'App' folder and vscode would be happy - no errors.

Now that I've changed the structure to have a single package.json and tsconfig.json which handles each app the workspace does not include the files due to them now being located in the root which leads to ts errors in my files.

The only workaround i have currently is to include my entire solution which isn't very desirable.

Having the ability to add individual files to the workspace means i could retain a workspace that only has my desired files in but means i could include the necessary files to not have errors.

@qiulang
Copy link

qiulang commented Jun 13, 2018

.gitignore, README and docker-compose.yml(my case) are the good examples to be in the root of my app folder.
Besides, I feel weird that although I can't add those files to my workspace I can just open a new window to open my app folder. All files inside my app folder will show but I can't debug my app (vscode shows 'no configuration') like when I use workspace.

@jalovatt
Copy link

jalovatt commented Jul 2, 2018

Yes please.

Due to the setup of the repository I'm working in, a particular project might have its own subfolder but also has to have a package file at root-level. Would be great to have the package as part of the workspace.

@IvanG96
Copy link

IvanG96 commented Jul 13, 2018

And i would say even more. Due to the project specific that i'm working on, i have several c# projects in the several folders that included into one visual studio solution. And there are hundreds of xml files in this folders that can't be made as part of solution.
So it would be really great and convinient to include all of them into vs code workspace by simple pattern like \xmlfolder**.xml

@bpasero
Copy link
Member

bpasero commented Sep 11, 2018

I am closing this "as designed". This is not a scenario we will support anytime soon. Please also see https://github.com/Microsoft/vscode/wiki/Issue-Grooming#out-of-scope-feature-requests

@bpasero bpasero closed this as completed Sep 11, 2018
@bpasero bpasero added the *out-of-scope Posted issue is not in scope of VS Code label Sep 11, 2018
@jefferysterner
Copy link

It's ridiculous that you aren't doing this. Not doing it defeats most of the purpose of having workspaces.

@TuxVinyards
Copy link

@bpasero I have to wonder if the bar isn't being set a bit high. There's an under-diiscussion label for bugs. Maybe the same is required for feature request.

@Others since contributing to this thread have wondered at times if it is actually desirable:

  1. I have started using symlinks as a work around, storing the files in the main folder and placing external links to these where needed.

  2. Other IDE's don't have, or may not have this feature. This feature would limit the intersharability of code and makes me wonder about my support for it.

@devuxer
Copy link

devuxer commented Oct 23, 2018

Looking at the criteria in https://github.com/Microsoft/vscode/wiki/Issue-Grooming#out-of-scope-feature-requests, I'm a little confused why this was closed.

  1. Does the functionality described in the feature request have any reasonable chance to be on the next roadmap?

This doesn't really seem to be a criterion on its own. It's very dependent on (2) and (3).

  1. Are the costs to implement the functionality reasonable given the size of our team? I.e. can we afford the feature?

If allowing some loose files or folders at the same level as project folders has a particular high cost, it would be helpful to get a brief explanation why that is the case. The project folders themselves would seem much more complicated to implement, given all the special UI treatment they get. I would also argue that allowing a .vscode folder for the whole workspace, rather than embedding settings and launch configuration into the code-workspace file and ignoring certain settings set at the project-level that conflict (like zoom), you would end up with a much cleaner, "fully baked" system.

  1. Has the community at large expressed interest in this functionality? I.e. has it gathered more than 10 up-votes or more than 10 comments over the last 6 months? Just for reference, the up-vote criterion alone covers more than 500 feature requests as of right now, September 10th, 2018. We also look at the duplicates for this analysis.

This post has 28 upvotes in the last seven months and this comment will be the 10th.

Would the team consider giving this one more look?

EDIT: better make that 125 votes and counting, as of 11 MAY 2020.

@MrRobboto
Copy link

30th Upvote.

I was very glad to start using workspaces, instead of having my entire root folder in VS Code which has word documents and crap. I was able to just have the main folders I code in (Web, API, and DB for this main project I'm on).

I was surprised to find I couldn't add a couple other files to the workspace that would be nice to show up right next to the main folders. Specifically Readmes would be nice and also I like to put the API .sln there so I can quickly go to view it in explorer and open it in VS (I avoid going in there).

Anyway, this seems like it would obviously be on the roadmap to go along with Workspaces as they are. If there's a ton of other backlog more important I'd get a delay but to close this seems wrong.

If a workspace files feature is so far down on the list that it will never get done, then workspace folders should be right there with it and shouldn't have been done. I'm not following the logic that implementing with folders was important enough to do and just stop there...

@MrRobboto
Copy link

@TuxVinyards

Thanks for suggesting Symlinks, I ended up going this route as well for a workaround and it's not too bad, basically achieves what I was trying.

I added a "Links" folder to my workspace which just has a list of Symlinks to files I wanted to include in the workspace.

@i-am-malaquias
Copy link

There does seem to be interest for this feature.
Maybe an easier way to implement this would be the ability to hide files/folders from the workspace structure?
I wouldn't mind adding the entire root folder and then choosing what I don't want to see in the explorer, probably.
This approach also makes more sense in cases where you create new files in the project, they would automatically show up in the explorer if they're not in an exclusion list, otherwise you would have to manually add new files to the explorer.

@MrRobboto
Copy link

MrRobboto commented Nov 13, 2018

@MrGoDuck @TuxVinyards

Yeah, that would work and offers plenty of flexibility - I would absolutely be in favor of that.

PS - My hard links are breaking (not sure which app is overwriting files but it happens - I hope it's not VS Code). So I had to get rid of my "Links" folder. I am back to just searching for the files I'm looking for when I'd ultimately like hard links in the root, included in the workspace.

Ex of the ideal:

API
--Models
----Model.cs
----A bunch of other files crowding the space...
Web
--Models
----App Model.ts
--Etc.
APIModel.cs (h link included in ws)
WebModel.ts (h link included in ws)

A bit unrelated but it seems like VS Code might be the one breaking my hard links...! I had the two links in a "Links" folder included in the workspace and it was working perfectly for a session and then broke. I didn't open the files in any other app.

@TuxVinyards
Copy link

@MrGoDuck Sounds like the start of an algorithm. What are you like at Typescript? Might work adding lines to the .jsn. manually ..

Not tried the above. @MrRobboto my symlinks method is still working for me. Maybe VS Code doesn't play nicely with links? I have only 'real' files in the working folder. The outside files as links works but does have limitations. Maybe an OS issue?

@Jeffrey-Hall
Copy link

I found it hard to believe I could not add files to my workspace. Please reconsider this feature request.

@josiah47
Copy link

I too found it ridiculous that this was not a feature.

@raosatish
Copy link

Yes. Please add the ability to add individual files to the workspace.

@safield
Copy link

safield commented Nov 28, 2018

+1

@IvanG96
Copy link

IvanG96 commented Nov 29, 2018 via email

@EstevezCarlos
Copy link

+1 MS PLZ

I have a walk around:

  1. I add folder that contains files I need.
  2. I install Make Hidden extension.
  3. I hide files that i do not want to see in my workspace.

@i-am-malaquias
Copy link

@EstevezCarlos
This should be available without the use of an extension.

@bpasero bpasero reopened this Dec 9, 2022
@bpasero bpasero added workbench-workspace Workspace issues keep Issues we should not close as out of scope and removed workbench-multiroot Multi-root (multiple folders) issues *out-of-scope Posted issue is not in scope of VS Code labels Dec 9, 2022
@bpasero bpasero changed the title Allow "files" field in .code-workspace file Allow a workspace to show individual files from other folders Dec 9, 2022
@communque
Copy link

FWIW I built a personal extension. Haven't posted it b/c of its limited scope, but the basic idea is this:
It creates a new Sidebar Panel (in addition to the existing Workspace Panel. I think everyone would prefer to simply extend the existing Workspace panel). It uses the same (albeit modified) .code-workspace file.

The original plan was to create a panel whose file list would be populated

  • by the existing "Folders" array in the 'workspace' file
  • by a newly-added "Files" array for additional items
  • by an array of regex entries, so that file items could be included dynamically.
    There's really no limit to what's possible.

I got as far as the "Files" array, it worked, and discovered the others weren't even needed, at least not immediately, so to date haven't gone back and elaborated the extension. Haven't used the built-in Workspace panel since.

In the end it would seem there's probably no need to even distinguish between "Folders" and "Files" or even a "Regex" arrays. They could all be listed in one array, and a bit of coding could figure it out.

ScreenGrab2

@moseleyi

This comment was marked as duplicate.

@tschoepping
Copy link

@bpasero
That's what I was referring to. This way you can add individual files from any directory as described here. That method is quite verbose, though, so that a files node would be a much more readable short version.

Thank you for reopening this issue!

@bdetry
Copy link

bdetry commented Dec 28, 2022

Thanks, @tschoepping, for the stack overflow answer. I have used it to do this walk arround :

image

So I add the "folders" I want and the folder with everything too (the last "folder")

Then I ignore everything except the ones I want. In this case "package.json" but It will be in another "workspace folder" (the one I named Project folder)

@illustrious-otter
Copy link

I use projects with just a few files all the time - it is often required to make changes in a group of functionally related files that live in completely different places.

Another common use is top level code (perl/python/bash etc.) that uses a relative library dir, but itself lives amongst a bunch of other executables.

I am a recent convert to vs code after decades of using bbedit - for an example of how individual files can work easily and powerfully in a workspace, take a look at bbedit's implementation (they call them projects) - it is excellent and shows that it can be done without any UX confusion. I greatly prefer this approach over using hard or soft links as they always seem to bite me on the bum eventually...

@EntranceJew
Copy link

EntranceJew commented Sep 20, 2023

FWIW I built a personal extension. Haven't posted it b/c of its limited scope, but the basic idea is this: It creates a new Sidebar Panel (in addition to the existing Workspace Panel. I think everyone would prefer to simply extend the existing Workspace panel). It uses the same (albeit modified) .code-workspace file.

I would really appreciate it if you were to release this.

@tsanyqudsi
Copy link

tsanyqudsi commented Oct 24, 2023

Thanks, @tschoepping, for the stack overflow answer. I have used it to do this walk arround :

image

So I add the "folders" I want and the folder with everything too (the last "folder")

Then I ignore everything except the ones I want. In this case "package.json" but It will be in another "workspace folder" (the one I named Project folder)

I use this approach and I think it's not workaround. I think this is the correct way. This way, there's a choice whether user wants to use Multi Root Workspaces or not without headache.

@bpasero, CMMIW but I think this approach should be on documentation.

@gsimardnet
Copy link

To me, it seems like a temporary workaround. The list of "files.exclude" could get very long and this setting applies to every folder so you could inadvertently exclude a "file" (or folder) somewhere else in your project.

@EntranceJew
Copy link

I agree, the whole reason for wanting to include only particular files is because of the swathe of other files in a folder I'd otherwise include.

@dlordi
Copy link

dlordi commented Oct 24, 2023

This looks like another workaround to me.

@kevcmk
Copy link

kevcmk commented Jan 14, 2024

Unbelievable that this isn't addressed yet

@thomasrea0113
Copy link

Actually shocking that this isn't implemented yet. Seems so simple

@ch0rl
Copy link

ch0rl commented May 11, 2024

+1 would be great to see

@flippinroo2
Copy link

flippinroo2 commented May 19, 2024

+1 - (Can't believe this has been open for 6 years O.o)

I have a single folder "python" that I use to mount into a Docker container.

The folder includes multiple files (the entire reason I need this feature):

  • README.md
  • .bashrc
  • .gitmodules

and then I have multiple sub-directories that each have their own launch.json configurations.

However, those launch configurations don't show up unless the folders are added as a multi-root workspace...

Then the dillema is I can't see the files in the root "python" folder when I do that.

(I currently have them inside of a single launch.json but it's over 4,000 lines long...)

@callahanp
Copy link

callahanp commented Jun 7, 2024

What kind of confusion would adding a feature that people have been asking for for years entail?

Workaround:
Create a directory for symbolic links to the additional files you are interested in for a given workspace.
Add that directory to your .code-workspace folders list.

No confusion at all, but the extra effort should not be necessary.

I should be able to add something like this to my.code-workspace:

"folders": [ ],
"additional_files": [ "path-to-file", "path-to-another-file" ]

Could anyone explain why the vscode development community has been reluctant to add this feature?

@MariuzM
Copy link

MariuzM commented Sep 5, 2024

I’ve started using this workspaces but damn yeah this is really missing feature.

@qns7
Copy link

qns7 commented Sep 9, 2024

What kind of confusion would adding a feature that people have been asking for for years entail?

Workaround: Create a directory for symbolic links to the additional files you are interested in for a given workspace. Add that directory to your .code-workspace folders list.

No confusion at all, but the extra effort should not be necessary.

I should be able to add something like this to my.code-workspace:

"folders": [ ], "additional_files": [ "path-to-file", "path-to-another-file" ]

Could anyone explain why the vscode development community has been reluctant to add this feature?

THANK YOU! I didn't think of symbolic links and this works perfectly.♥️
I tried "macOS-GUI-aliases" before and that didn't work.

@moseleyi
Copy link

moseleyi commented Sep 9, 2024

How many singular files we have these days to compliment our programming? All the files that start with the dot and so on. It would be extremely useful to have access to files that pertain to our folders and repositories but are stored outside of it .ssh .dbt .bashrc and all the other ones

@iireland-ii
Copy link

^per the above i use all these config files frequently and it would be incredibly handy to have this feature.

@dlordi
Copy link

dlordi commented Nov 7, 2024

Here's my ridiculous workaround:

  • use a random directory as VSCode project
  • create a FILES.md file and pin it
  • use markdow links to refer files around the disk, ALT+click to open them
    Image

@jirpok
Copy link

jirpok commented Nov 8, 2024

Here's my ridiculous workaround:

* use a random directory as VSCode project

* create a FILES.md file and pin it

* use markdow links to refer files around the disk, ALT+click to open them
  ![Image](https://github.com/user-attachments/assets/561f1cec-bbc6-43a9-9f8d-56b42e2a8c23)

Hey @dlordi, FYI, symbolic links work just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality keep Issues we should not close as out of scope workbench-workspace Workspace issues
Projects
None yet
Development

No branches or pull requests