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

Add guest support for multi-root workspaces / solutions #46

Closed
Chuxel opened this issue Jan 16, 2018 · 28 comments
Closed

Add guest support for multi-root workspaces / solutions #46

Chuxel opened this issue Jan 16, 2018 · 28 comments

Comments

@Chuxel
Copy link
Member

Chuxel commented Jan 16, 2018

Currently Live Share only supports a single root folder.

  • In VS Code, this means the recently added multi-root workspace feature is not yet supported for guests.
  • In VS, this means files from projects referenced in a solutions that are not in a folder at or underneath the solution file will not appear for guests.

This feature requests adding these capabilities into Live Share.

@lostintangent
Copy link
Member

lostintangent commented Jan 16, 2018

Additionally, it would be great to hear feedback about whether folks want to share "loose files" that they open during a collaboration session, but aren't actually part of the shared solution (VS) or workspace (VS Code).

@lumaxis
Copy link

lumaxis commented Feb 28, 2018

@Chuxel Any idea where this is on your priority list?

@Chuxel
Copy link
Member Author

Chuxel commented Feb 28, 2018

@lumaxis It's definitely one we know is important. Out of curiosity, what is your use case? Are you In VS or VS Code?

@lumaxis
Copy link

lumaxis commented Feb 28, 2018

In the VS App Center team, we are running several Node.js services which are mostly developed using VS Code. Recently, we also moved to one big mono-repo. In the mono-repo, we have several .code-workspace files that give us an immediately great dev experience for a certain combination of the projects in our mono-repo.

In my team, we also focus on knowledge sharing and try to do pairing and collaboration as much as possible. For those purposes, we recently started using Live Share as a tool, especially for the parts of our team that are remote.
Without support for multi-root workspaces, we today however have to open the entire mono-repo folder in the Live Share workspace and that understandably gets a bit confusing and sometimes also slow 🙂
Does that help @Chuxel ?

@Chuxel
Copy link
Member Author

Chuxel commented Feb 28, 2018

@lumaxis Yes, that's great info! Makes complete sense. This is definitely on-roadmap and we know it's important for VS solutions so it's great to hear about a concrete scenario like this for VS Code too given workspaces is a new-ish feature in the tool.

@TroySchmidt
Copy link

My example use case is converting a React Javascript app to TypeScript so setup a multi-root workspace with both folders that sit side by side to do the conversion. But when Live Sharing came across this issue.

@MarioLiebisch
Copy link

In my use case I'm trying to share a project built with CMake (Visual Studio as host).

📁 Project Root
  📁 build
    📃 ALL_BUILD.vcxproj
    📃 CMakeCache.txt
    📃 project.sln
    📃 <other VS files>
  📁 source
    📃 CMakeLists.txt
    📃 main.cpp
    📃 <other source files>
📃 CMakeLists.txt

None of the source files appear for a VS Code client, since they're outside the solution folder (i.e. build here).

@Chuxel
Copy link
Member Author

Chuxel commented Apr 24, 2018

Merging in #240 from @mihe, @DJLink


Issue from @mihe

Product and Version: VS 15.6.4, VS Code 1.22.2
OS Version: Windows
Live Share Extension Version: 0.2.400.25910 (VS), 0.2.405 (VS Code)
Target Platform or Language: C++

Steps to Reproduce / Scenario:

  1. Create a C++ solution in VS 2017 (15.6.4).
  2. Add to the solution a .cpp file that's located somewhere on disk that's not under the same file tree as the .sln file.
  3. Host a VS Live Share session.
  4. Join said session from either VS or VS Code.
  5. Note how the solution explorer in either client editor bases its solution explorer solely on the folder where the .sln file is located, and doesn't take the actual layout of the solution into consideration.
  6. Also note that when the host opens the file added in step 2 the client won't be able to see it.

This creates problems with any project where the .sln file isn't placed in some common parent directory to all of the source files. Unreal Engine 4 projects are one of those cases, where UE4.vcxproj (containing the source of the engine itself) is almost always placed outside of the scope of the .sln file.


Reply from @DJLink

I have this same issue. Some extra information, once I start a debug session and put a breakpoint in one of those files outside the project it will show on the other user session too, during that debug session

@matt-neal
Copy link

Further information for implementation and use-case, I work on a team developing full-stack on our own server and front-end architecture. The way our server runs, each of our products is a separate module, which I have open as separate folders within the workspace to keep from having massive, difficult to navigate file trees.
Obviously, for now, I can just utilize the server file and work from there, but ideally it would be nice to work in a per-product workspace with all dependencies loaded.

@hknielsen
Copy link

hknielsen commented May 9, 2018

@Chuxel What are the state of this issue?
All our sln's live in a separate folder hierarchy than our csprojs. So there are no *.cs's to live share.

Really looking forward for this, collaboration will improve so much when we can use local IDE instead of remote screen sharing.

@racemaniac
Copy link

Had the same issue, but also found a simple workaround that helped for how we wanted to use it: In visual studio select the solution file you want to share, and then in the file menu select save as. Save the solution file in a higher up directory where everything you need is in, and then for liveshare open that copy of the solution instead.
Until this is fixed this should at least allow you to share everything you need.

@cevn
Copy link

cevn commented Jul 3, 2018

This workaround only works for folders that can be co-located unfortunately. I have a workspace mixing golang and node and have no desire to put my javascript in my $GOPATH.

@jpike88
Copy link

jpike88 commented Aug 8, 2018

I've had to make a single folder for live share to work again. Shame this isn't higher up as a priority.

@lostintangent
Copy link
Member

@jpike88 Apologies for that inconvenience! Not only is this high priority, but we’re actually very close to finishing the work to fully support this. We’ll keep everyone updated on progress in the coming weeks 👍

@lostintangent
Copy link
Member

FYI, the latest version of Live Share adds support for multi-root workspaces in VS Code! You should be able to open multiple roots and simply click the Share button 🚀 Please let us know if you run into any issues, and we appreciate everyone's patience, and for putting up with some of the aforementioned workarounds 😄

We're working on the equivalent support in VS, and will keep everyone posted on progress. Thanks!

@lostintangent
Copy link
Member

Closing this as resolved, now that support for it has been added to VS 👍

@julee
Copy link

julee commented Dec 29, 2019

Closing this as resolved, now that support for it has been added to VS 👍

Hello, I find for solution in project subdirectory directory(such as ProjectA/win/ProjectA.sln), If I share it by live-share to visual studio code, The visual studio code can only navigate to source files in the solution file directory(e.g: ProjectA/win/ ), the source files in top project directory cannot navigated(elg: ProjectA/src/main.cc). How can I fix this? But if the session is save to another visual studio, I can navigate all the source files referenced by visual studio solution file.

Live Share extension version installed inVisual Studio is 1.0.1349.1, Visual Studio version: Microsoft Visual Studio Community 2019 16.4.2. Live Share extension in Visual Studio Code is: 1.0.1404.

@hknielsen
Copy link

Hi im also still having issues with csproj containing file and when the source is not a subdir of the csproj.
Should this work @lostintangent ?

@tcrossland
Copy link

Hi, is it possible that there has been a regression in this functionality? With the latest version of VSCode, my coworker is only seeing the first folder of the workspace.

@jacknight
Copy link

jacknight commented Aug 9, 2021

Hi, is it possible that there has been a regression in this functionality? With the latest version of VSCode, my coworker is only seeing the first folder of the workspace.

Same. I'm able to workaround it by manually editing the workspace configuration file from the remote VS Code to look something like these for each of the root folders:

"folders": [
        {
            "uri": "vsls:/",
            "name": "folder1"
        },
        {
            "uri": "vsls:/~2",
            "name": "folder2"
        },
        {
            "uri": "vsls:/~3",
            "name": "folder3"
        }
    ],

The tricky part is knowing which folder is which because you need to know the order of the root folders without being able to see them, and how many there are, etc. It's not ideal but it does work. Unfortunately, you need to repeat the process every time you connect to a live shared workspace.

@tcrossland
Copy link

See also #4034

@daytonellwanger
Copy link
Collaborator

I'm seeing the same thing. We're looking into it now. Sorry for the delay.

@daytonellwanger
Copy link
Collaborator

Should be fixed in the latest release 🎉

@RyanMilligan
Copy link

I'm using VSCode 1.60.2 with Live Share 1.0.4836, released the day @daytonellwanger said this issue should be fixed, and I'm still seeing the problem. The work-around given above of editing the code-workspace did temporarily resolve it for me, but I'm still not able to open files by name from the command bar if they're outside the first folder. That may be a separate issue, though.

@cube-drone
Copy link

I'm using VSCode 1.61.2, and seeing this problem, I think. Created a code share session and my compatriot is only seeing the first workspace.

@eqj
Copy link

eqj commented Nov 4, 2021

Same issue with both devs on 1.62.0; only 1 of 2 workspace folders is visible on the share

@vintprox
Copy link

vintprox commented Nov 13, 2021

Only first entry in folders array ({ "name": "Workspace Folder Pretty Alias", "uri": "vsls:/" }) has the genuine name preserved from *.code-workspace, while others are shared as-is ({ "name": "fs_folder_name", "uri": "vsls:/~1" }).

Not complaining, just saying it's weird 😅

@slaschinski
Copy link

slaschinski commented Jan 20, 2022

I also have the same problem, but I might have some insights here.
When I tried to do the workaround, mentioned above, I saved the workspaces and as soon as I did, the other folders appear. Also I'm getting the following message vom VSCode, which probably is related to the reason it is not working properly right now:
Extension 'Live Share' failed to update workspace folders: Error: Unable to write into the file because the file has unsaved changes. Please save the file and try again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests