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

[generator] Fix MSBuild warning/error format for VS. #765

Merged
merged 1 commit into from
Dec 17, 2020

Conversation

jpobst
Copy link
Contributor

@jpobst jpobst commented Dec 16, 2020

In #715 we made generator warnings/errors give line/col information in more places, however the existing method for formatting the line/col information was wrong:

// Correct
C:\code\Metadata.xml(2, 6): warning BG8A04: <attr path="/api/package[@name='androidx.appcompat.widget']/class[@name='RoundRectDrawableWithShadow']"/> matched no nodes.

// Incorrect
C:\code\Metadata.xml(2, 6) warning BG8A04: <attr path="/api/package[@name='androidx.appcompat.widget']/class[@name='RoundRectDrawableWithShadow']"/> matched no nodes.

By omitting the colon after the line/col information, VS parses the colon in C:\ instead, resulting in:
image

This is actually worse than what we previously had, as double-clicking it does nothing, since C is not a valid file on disk.

This commit rewrites the Format function to be a little clearer to read and adds the needed colon.

@jpobst jpobst marked this pull request as ready for review December 16, 2020 20:46
@jpobst jpobst requested a review from jonpryor December 16, 2020 20:47
@jonpryor jonpryor merged commit 876442f into master Dec 17, 2020
@jonpryor jonpryor deleted the report-loc-fix branch December 17, 2020 18:14
@jpobst jpobst added this to the 11.1 (16.9 / 8.9) milestone Jan 5, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2024
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.

2 participants