Skip to content

VB Generator Fixes#45624

Merged
333fred merged 1 commit intodotnet:masterfrom
333fred:vb-newline-fixes
Jul 7, 2020
Merged

VB Generator Fixes#45624
333fred merged 1 commit intodotnet:masterfrom
333fred:vb-newline-fixes

Conversation

@333fred
Copy link
Member

@333fred 333fred commented Jul 2, 2020

Generate VB code in a platform-agnostic manner that does not introduce cr's on non-windows platforms.

… generators on Linux doesn't produce newline differences.
@333fred 333fred requested a review from a team as a code owner July 2, 2020 20:38
@333fred
Copy link
Member Author

333fred commented Jul 2, 2020

@dotnet/roslyn-compiler for a review of this small change.

tokenText = tokenText.Replace("""", """""")
End If

If tokenText IsNot Nothing AndAlso tokenText.Contains(vbCrLf) Then
Copy link
Member Author

Choose a reason for hiding this comment

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

LineContinuationTrivia encodes a CRLF into it's TokenText. We replace this with whatever the environment newline is.

@RikkiGibson
Copy link
Member

Should there be some assertion that the generated code does not introduce CR characters if it is not running on Windows?

@333fred
Copy link
Member Author

333fred commented Jul 3, 2020

Should there be some assertion that the generated code does not introduce CR characters if it is not running on Windows?

In principle, yes. However, unless we actually run the generators on a Linux/Mac run, realistically you or I are going to be the ones that hit it later down the line, and it's already visible as git diff changes when those files aren't touched.

@333fred
Copy link
Member Author

333fred commented Jul 7, 2020

@RikkiGibson any further comments?

Copy link
Contributor

@kevinsun-dev kevinsun-dev left a comment

Choose a reason for hiding this comment

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

Looks good to me. :shipit:

@RikkiGibson
Copy link
Member

However, unless we actually run the generators on a Linux/Mac run, realistically you or I are going to be the ones that hit it later down the line, and it's already visible as git diff changes when those files aren't touched.

Got it, I guess we only run the generators in the correctness run currently?

@333fred
Copy link
Member Author

333fred commented Jul 7, 2020

Got it, I guess we only run the generators in the correctness run currently?

Yep.

@333fred 333fred merged commit 8d5b404 into dotnet:master Jul 7, 2020
@333fred 333fred deleted the vb-newline-fixes branch July 7, 2020 20:46
@ghost ghost added this to the Next milestone Jul 7, 2020
@JoeRobich JoeRobich modified the milestones: Next, 16.8.P1 Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants