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

F#: The files in solution need to be ordered in project file order #1875

Closed
srivatsn opened this issue Mar 28, 2017 · 18 comments
Closed

F#: The files in solution need to be ordered in project file order #1875

srivatsn opened this issue Mar 28, 2017 · 18 comments
Assignees
Labels
Area-F# Specific to the F# language.
Milestone

Comments

@srivatsn
Copy link
Contributor

Instead of being sorted alphabetically we need to display the tree in the project file order.

Also, we need gestures to move a file up\down and Add a file above\below.

@srivatsn srivatsn added Area-F# Specific to the F# language. Feature Request labels Mar 28, 2017
@saul
Copy link

saul commented Mar 28, 2017

cc @KevinRansom

As discussed in dotnet/fsharp#2692:

I think I've already got a solution that means we can use the standard Solution Explorer, have a fixed compile order and allow files to be specified in any order.

Beneath the "Dependencies" node in the Solution Explorer, we should have a "Compile Order" node. This node contains a flat list of files - in the exact order that they're in the MSBuild file, including their relative paths.

The rest of the Solution Explorer is just as a C# project - we can use this as is. We just need to make sure that when a file is added, we add it to the Compile Order node - likewise for deletion.

I think this method is simple, clear and solves many of the weird edge cases we have with rendering multiple folders etc. It will also be a huge boost to just use as much as Roslyn's project system as possible without us having to hack around it for our snowflake compilation.

@davkean
Copy link
Member

davkean commented Mar 30, 2017

We came up with a agreement with CPS on controlling display order, we also need it for C# and VB for our special nodes: #1896.

@srivatsn srivatsn modified the milestone: 15.3 Mar 31, 2017
@cloudRoutine
Copy link

@saul I'm confused about how this is supposed to work, so when the files are rendered under the project node in the solution explorer, they won't appear in compile order anymore?

@KevinRansom
Copy link
Member

@cloudRoutine

CPS currently sorts files in alphabetic order under the project. Hopefully we will get that fixed, although there is some pushback on doing that. Regardless of that, with the presence of folders in the project, there is no mechanism other than manually editing the project file to arrange things in the correct order for the compiler. This proposal adds a new node where compiler order is rendered. The cps solution explorer may arrange them in whatever order they like at that point.

@cloudRoutine
Copy link

@saul some additional questions about this new compile order node -

  • will it be possible to select and move blocks of files simultaneously, or will it be necessary to move them one at a time?
  • when a file is a added to a folder in the project tree where does it go in the compile order?
  • can files be added directly to the compile order node? if so where do they appear in the project tree?
  • when a file is moved in the project tree an additional move needs to be made in the compile order node as well?
  • will the compile order node support
    • add above/below?
    • paste above/below?
  • if a file is being used as a link in the project tree and the link uses a different name than the file on disk how does the compile order node indicate this?
  • does the compile order node enforce signature and implementation file grouping and ordering?
  • will the compile order nodes show error/warning squiggles when there is a compilation error/warning in that file?

@saul
Copy link

saul commented Apr 1, 2017

@cloudRoutine:

  1. Yes you will be able to move multiple items, it's simple to code
  2. Another dialog will appear after doing "Add New"/"Add Existing" in the Solution Explorer asking you where you want to place the file
  3. Yes files can be added directly to the Compile Order node. They will appear in alphabetical order in whichever folder they usually reside in
  4. You won't be able to move files in the project tree (as with C#)
  5. Yes the Compile Order node will support add above/below and whatever other features we add to it
  6. The Compile Order node will just show the path to the actual file (e.g., ....\Foo.fs). The project tree will show the link file
  7. The Compile Order will not force an ordering, just as it currently doesn't
  8. Yes the Compile Order nodes will be able to show error/warning squiggles. Also double clicking a node in the Compile Order will open that file as normal.

Also for discoverability I think a "Select this file in the Compile Order" option in the right-click menu for the files in the project tree will be useful too.

@srivatsn
Copy link
Contributor Author

Need to check if ordering support is needed to do even the separate node proposal or if we can draw them as graph nodes\AttachedCollectionSource - @tmeschter @natidea can we order those nodes?

@saul
Copy link

saul commented May 22, 2017

@tmeschter @natidea Any update on this? Thanks :)

@MattGertz MattGertz modified the milestones: 15.6, 15.3 May 28, 2017
@MattGertz
Copy link

We are in the "no new features" part of 15.3. By default, this no longer meets the bar and is now moved to post-15.6. I'm willing to have the discussion if there is something low-risk in-hand that can be applied here, since I certainly understand & appreciate the F# community view & history here, but project team has a lotta bugs to fix in a very short amount of time, and we're less than a handful of days from Escrow.

@saul
Copy link

saul commented May 29, 2017

@MattGertz that makes sense. It's a shame it was ignored for so long on the assumption that it's not needed. Speaking of which I'm still waiting to hear back from Tom and Nat as to whether this is necessary at all with what we've got already... @tmeschter @natidea

@tmeschter
Copy link
Contributor

@saul @srivatsn Sorry, I lost track of this question. I can only speak to the possibility of implementing this using IAttachedCollectionSource. I believe that, yes, we can control the ordering of the nodes returned by a single IAttachedCollectionSource instance. What we can't do is merge and order two sets of nodes from two different IAttachedCollectionSource instances, though I doubt that is necessary.

Implementing an IAttachedCollectionSource to handle this should be reasonably straight-forward. I think the harder part will be defining and implementing an interface on the project system provide the nodes in the correct order, and support moving them around.

@cartermp
Copy link
Contributor

Can this be closed in favor of #2793?

@brettfo
Copy link
Member

brettfo commented Oct 13, 2017

Not necessarily. #2793 (I think) refers to how the compiler and design time builds get the ordered files, not how they're displayed in the Solution Explorer. @KevinRansom for more info.

@KevinRansom
Copy link
Member

@cartermp this is tracking @davkean's work. So pls leave it active for now.

@Pilchie Pilchie assigned davkean and unassigned brettfo Nov 1, 2017
@Pilchie Pilchie removed this from the 15.5 milestone Nov 1, 2017
@Pilchie Pilchie added this to the 15.6 milestone Nov 1, 2017
@Pilchie
Copy link
Member

Pilchie commented Nov 1, 2017

We've got it backwards - #2793 is tracking the solution explorer work (and @natidea has PRs out here and to CPS to fix that).
This tracks how we get the ordered files to the language service. @KevinRansom has a workaround for that, so moving this to 15.6.

@Pilchie
Copy link
Member

Pilchie commented Dec 19, 2017

@TIHan - you should join this repo so that I can assign issues to you :)

@Pilchie
Copy link
Member

Pilchie commented Dec 19, 2017

We currently have a workaround in place for this that @KevinRansom added, but @davkean had a different way that he thought we should do this in 15.6. @davkean is that still relevant?

@davkean
Copy link
Member

davkean commented Jan 4, 2018

This issue is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-F# Specific to the F# language.
Projects
None yet
Development

No branches or pull requests