Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

Do not generate C# line pragmas without a file path. #1178

Merged
merged 1 commit into from
Apr 4, 2017

Conversation

NTaylorMullen
Copy link
Member

  • Prior to this change default imports would get line pragmas generated for them because thye'd have a source location but no file path (they were a dynamic document).
  • Re-generated C# files to reflect new line pragma changes.

#1110

Copy link
Contributor

@ajaybhargavb ajaybhargavb left a comment

Choose a reason for hiding this comment

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

Minor comments

if (string.IsNullOrEmpty(documentLocation.FilePath))
{
// Can't build a valid line pragma without a file path.
return new NoopDisposable();
Copy link
Contributor

Choose a reason for hiding this comment

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

Return a static instance instead of newing it up everytime

@@ -632,5 +638,12 @@ public void Dispose()
.SetIndent(_startIndent);
}
}

private class NoopDisposable : IDisposable
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest NullDisposable or EmptyDisposable. Feel free to ignore this comment.

- Prior to this change default imports would get line pragmas generated for them because thye'd have a source location but no file path (they were a dynamic document).
- Re-generated C# files to reflect new line pragma changes.

#1110
@NTaylorMullen NTaylorMullen merged commit dda9cf3 into dev Apr 4, 2017
@NTaylorMullen NTaylorMullen deleted the nimullen/nullfilepaths.1110 branch April 4, 2017 22:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants