Skip to content

Conversation

@dakotahawkins
Copy link
Collaborator

de88fd1 added a check to prevent adding a newline before the last line in
a batch. Since we're prepending, however, a newline is desirable if the
last line is the only one in its group.

Fixes #48

de88fd1 added a check to prevent adding a newline before the last line in
a batch. Since we're prepending, however, a newline is desirable if the
last line is the only one in its group.

Fixes Wumpf#48
@dakotahawkins
Copy link
Collaborator Author

dakotahawkins commented Sep 26, 2017

I assume updating the packages is OK, but your comment in #47 worries me w.r.t. VS2015 compatibility.

I'll see if I can test it (my VS environments are a little messed up at the moment).

👎 Doesn't work! 👎

firstLine = false;
}

while (hasElements)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran into this issue again, and I think the above is a cleaner fix.

sortedIncludes = sortedIncludes.OrderBy(x => x.LineDelimiterType == IncludeLineInfo.DelimiterType.Quotes ? 0 : 1);

// Finally, update the actual lines
// Merge sorted includes with original non-include lines
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of doing what we were doing before to insert original non-include lines, this merges those in ahead of time. That way, there's less weird broken logic trying to do it on the fly :)

<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="IncludeToolbox.Andreas Reich.075c2e2b-7b71-45ba-b2e6-c1dadc81cfac" Version="2.2.0.1" Language="en-US" Publisher="Andreas Reich" />
<Identity Id="IncludeToolbox.Andreas Reich.075c2e2b-7b71-45ba-b2e6-c1dadc81cfac" Version="2.2.1" Language="en-US" Publisher="Andreas Reich" />
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug fix versioned

";
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll see a lot of empty lines in the "expected output", because every test except one removes duplicates, and there are a lot of duplicates.

@dakotahawkins
Copy link
Collaborator Author

2015 is broken, probably by NuGet updates.

@dakotahawkins dakotahawkins changed the title Remove check that prevents adding newlines before the last line (also update NuGet packages) Remove check that prevents adding newlines before the last line Sep 26, 2017
@dakotahawkins
Copy link
Collaborator Author

New PR: #50

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant