-
Notifications
You must be signed in to change notification settings - Fork 390
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
Use new dataflow that will provide files in project file order. #2793
Comments
For any folks coming here from the test day: This is what prevents Solution Explorer from displaying F# files in their compile order specified by the project file. |
Any time frame for this "feature request"? |
I'll be working on this next week, prototype here from CPS, except we need to change IProjectTreeCustomizablePropertyValues2.DisplayOrder instead adding a flag: [Export(typeof(IProjectTreePropertiesProviderDataSource))]
[AppliesTo("OrderedTree")]
private class TreeItemOrderPropertyProviderSource : ChainedProjectValueDataSourceBase<IProjectTreePropertiesProvider>, IProjectTreePropertiesProviderDataSource
{
[Import(ExportContractNames.Scopes.UnconfiguredProject)]
private IOrderedSourceItemsDataSourceService OrderedItemSource { get; set; }
[ImportingConstructor]
public TreeItemOrderPropertyProviderSource(UnconfiguredProject project)
: base(project.Services)
{
}
protected override IDisposable LinkExternalInput(ITargetBlock<IProjectVersionedValue<IProjectTreePropertiesProvider>> targetBlock)
{
this.JoinUpstreamDataSources(this.OrderedItemSource);
TreeItemOrderPropertyProvider latestTreeItemOrderPropertyProvider = null;
var providerProducerBlock = new TransformBlock<IProjectVersionedValue<IReadOnlyCollection<ProjectItemIdentity>>, IProjectVersionedValue<IProjectTreePropertiesProvider>>(
orderedItems =>
{
if (latestTreeItemOrderPropertyProvider?.OrderedItems != orderedItems.Value)
{
latestTreeItemOrderPropertyProvider = new TreeItemOrderPropertyProvider(orderedItems.Value);
}
return new ProjectVersionedValue<IProjectTreePropertiesProvider>(latestTreeItemOrderPropertyProvider, orderedItems.DataSourceVersions);
});
providerProducerBlock.LinkTo(targetBlock, new DataflowLinkOptions() { PropagateCompletion = true });
return this.OrderedItemSource.SourceBlock.LinkTo(providerProducerBlock, new DataflowLinkOptions() { PropagateCompletion = true });
}
private class TreeItemOrderPropertyProvider : IProjectTreePropertiesProvider
{
public TreeItemOrderPropertyProvider(IReadOnlyCollection<ProjectItemIdentity> orderedItems)
{
this.OrderedItems = orderedItems;
}
public IReadOnlyCollection<ProjectItemIdentity> OrderedItems { get; }
public void CalculatePropertyValues(IProjectTreeCustomizablePropertyContext propertyContext, IProjectTreeCustomizablePropertyValues propertyValues)
{
if (propertyContext.ParentNodeFlags.Contains(ProjectTreeFlags.ProjectRoot) && !propertyContext.IsFolder)
{
int index = this.OrderedItems.TakeWhile(item => !string.Equals(item.EvaluatedInclude, propertyContext.ItemName, StringComparison.OrdinalIgnoreCase)).Count();
propertyValues.Flags = propertyValues.Flags.Add($"Order:{index}");
}
}
}
} |
Adding @natidea - can you take a look at this? |
Moving back to 15.5 - @natidea has the changes here ready to go. |
@natidea this should be closed now, right? |
Closed via #2930 |
@natidea When I re-order files in my fsproj in VS15.5 preview 4, the Solution Explorer does not update. Renaming the files in the fsproj does cause the Solution Explorer to update though. This isn't a major issue, as I can just unload and reload the project after re-ordering the files. |
Propagate file order to workspace projects.
The text was updated successfully, but these errors were encountered: