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

Make compile errors public when using CSharpier.Core #799

Closed
belav opened this issue Jan 21, 2023 · 1 comment · Fixed by #825
Closed

Make compile errors public when using CSharpier.Core #799

belav opened this issue Jan 21, 2023 · 1 comment · Fixed by #825
Milestone

Comments

@belav
Copy link
Owner

belav commented Jan 21, 2023

This is a suggestion from #783

I'd like to get the error using the API, but it seems this is not possible currently. (https://github.com/hofstadter-io/hof/blob/_dev/formatters/tools/csharpier/Program.cs)

Looking at https://github.com/belav/csharpier/blob/master/Src/CSharpier/CodeFormatter.cs it seems the public methods only return the result.Code field. Could we add something like FormatWithErrors and FormatWithErrorsAsync that exposes the more complex return CodeFormatterResult?

@verdverm
Copy link

verdverm commented Mar 9, 2023

Can confirm this is working for my use case, thanks @belav

https://github.com/hofstadter-io/hof/blob/_dev/formatters/test/cs_fail.txt

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

Successfully merging a pull request may close this issue.

2 participants