-
Notifications
You must be signed in to change notification settings - Fork 804
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
Improved project folder support #2692
Conversation
@vasily-kirichenko is that a feature request or a regression? :) |
Ah. I know why this is. The path separators need to be backslash |
So... I think it should work with both types of slashes since it's very likely |
Wow, it would be great to get this in. |
@cloudRoutine that's what I did. |
bizarre, this is the only way that works consistently for me |
@cloudRoutine it's because Vasily had Linux-style directory separators in some of the files in his .fsproj - I'm fixing that now |
@vasily-kirichenko @cloudRoutine fixed in 4d33380 I've also just re-enabled support for "Add folder" on the project node: |
Wow this is so cool. Thanks so much for doing this. |
awesome! will test it tomorrow. |
Just fixed cut/copy and pasting files around: |
@saul You're a rockstar. Love it! |
@saul everything works great. Very cool :) Any plans to add drag-n-drop support? :) |
Can we try to get the first batch in? It would immediately be helpful. Further improvements like draggedy-droppery-mousy-minkie could be added in another PR. |
@forki my plan is to just fix the stuff that's there for the minute (see my incomplete check boxes in the PR description |
A bit more progress - coming close for this to be merged. I've reworked how the Solution Explorer and project file are synchronised. Any operation on a file in the Solution Explorer is no longer attempted to be 'replayed' on the project file (e.g adding a file to the Solution Explorer would try to move it to where we expected it in the project file). Instead, the file is added to the Solution Explorer to the most reasonable place, and then moved elsewhere if possible. Wherever the file ends up, the build project will replicate. This means it should no longer be possible for the Solution Explorer and project file to become 'out of sync'. An example error is shown below: |
@nelak Yes, see the suggestion links above - please add your comments there. |
@saul I hope you haven't given up on this PR in favor of CPS work, which is all well and good but it'll be months before we get our hands on it. Whereas this makes some really useful material gains that can be taken advantage of today (I merge this PR into my custom tools branch, no nightlies for me 😉 ) |
@cloudRoutine @saul @KevinRansom In the context of open source working, I think there can be "prime the pump" advantages to accepting feature work like this, even if it is later thrown away and replaced when CPS comes. Specifically, it can help familiarize contributors with a feature area, making it easier to implement/debug/extend/correct/... the feature second time around. And people get to use and debug the UX for the feature early. And people also get very motivated to ensure the feature works in the later version as well. I think the community experience with VFPT was somewhat similar - although built with the pre-Roslyn VS integration, the lessons, code, UX and so on were all incredibly valuable. And it was/is a highly valuable set of tools in its own right. So VFPT was definitely "worth it" as it primed the pump for the Roslynized version, as well as being useful in its own right. |
I agree that this would be good to get in. The CPS work is currently scheduled for 15.3, which will be in a July timeframe, but as that work progresses we may have to cut scope. I'm also not convinced that we'll be able to completely switch over to that project system for .NET Framework projects in that time frame. Since .NET Framework represents the vast majority of projects in .NET, improvements like this are wonderful. |
@dotnet-bot test this please |
@cloudRoutine @KevinRansom I don't think this will be completed this week. Time constraints are making this week particularly difficult, but next week I'm hoping to have this (and the rest of my PRs!) merged. Apologies for the delay, but rest assured I haven't given up on this. |
I think the following tasks should be moved to a separate issue/PR:
I think they're great things to have but I think this is feature creep. 'Virtual folders' don't exist as a concept within the project system at present, so it'd be a lot of new code to add this. Also will take a look at the failing tests soon then this will be ready to merge. |
Also @cloudRoutine as requested, here's what happens when you try to rename a folder (that is not empty) to a folder that already exists: Note if the folder you're trying to rename is empty, it does it without complaining now. |
I don't know what you mean by "exist as a concept" but you can definitely have virtual folders within a project. <ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="Library1.fs" />
<None Include="Script.fsx" />
<Content Include="packages.config" />
<Compile Include="one.fs">
<Link>virtual-folder\one.fs</Link>
</Compile>
<Compile Include="two.fs">
<Link>virtual-folder\two.fs</Link>
</Compile>
</ItemGroup> You see a folder node in the project tree, there is no corresponding folder on disk. @saul whatever you're thinking of is way more complicated than it needs to be |
No idea what the test failure is here because I can't even view the whole file |
|
@majocha Thanks - but how in god's name did you find that? |
@saul I saved `view as plain text' link to text file :) |
@saul |
…at has the same name as an existing file
Removed the failing test as it's impossible to reproduce in a real-world scenario. The test was doing the following: In a project with the following MSBuild:
It was simulating adding the "a.fs" to the project. Now in VS proper this is a no-op - VS detects that the file is already in the project and does nothing. The test was simulating this about 5 layers deep and so some assumptions were failing. I don't believe they need addressing as the scenario can't be reproduced in a real-life scenario anyway. |
@saul is it your recommendation that this is reviewable. |
@KevinRansom reviewable and in a state to be merged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work.
@saul Thanks for this it looks great. Kevin |
Fixes #2178, #2048, #2539, #1095 and #732
Folder node selected
File node selected
Cut & Paste
Add > Add Existing...
"Add Folder"
Miscellaneous