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

Add option to hide "Error in StylerPackage" popup message #387

Open
chris84948 opened this issue Jun 4, 2022 · 5 comments
Open

Add option to hide "Error in StylerPackage" popup message #387

chris84948 opened this issue Jun 4, 2022 · 5 comments

Comments

@chris84948
Copy link

I love this extension, but since updating to VS 2022, I've noticed a small difference in how it runs.

Whenever I save the file, if there are errors in the XAML, it shows a popup containing the error information
image

Is there an option anywhere to turn this off? If not, can this be added? My workflow is to just keep writing the XAML and every time I accidentally hit CTRL-S to format, if an error exists, it pops this up and I find it pretty distracting.

Thanks!

@grochocki
Copy link
Contributor

@chris84948 This appears when there is an issue processing the XAML markup. Would it be possible to share a snippet of XAML for what is on line 48 of the file you are attempting to format?

@chris84948
Copy link
Author

I can definitely attach a sample, but it's not really about the XAML itself. I know the code has an error, but it's more about having to deal with a popup every time it tries to format, while an error is in place. I'd rather it just have a silent error.

I think in the 2019 version it would silently fail, and that's honestly what I'd prefer.

Here's a bare minimum sample

<UserControl x:Class="Binding.UserControl1"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
</UserControl>

image

@grochocki
Copy link
Contributor

I am assuming as part of your flow, you are saving as you go (i.e., before you get to adding the >). I can reproduce with that sample code in both VS2019 and VS2022. You can disable Format on Save, though, so perhaps you had this off in your VS2019 instance?

This is a parser error when encountering malformed XAML (which we can't format). We may be able to improve this experience in the future as part of #271 (including possibly helping you identify and fix these issues instead of the somewhat cryptic error message we show today).

@chris84948
Copy link
Author

I'm not really looking for more information, it's fairly clear that it didn't format.

I guess I'd just like it to silently fail instead of constantly popping up that error.

@DaveInCaz
Copy link

I've definitely seen this popup in VS2019 from time to time.

The format on save option is very useful, I wouldn't want to disable that to avoid the popup.

Could this popup be removed entirely, perhaps, and the error message added instead to the VS errors/warnings list?

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.

3 participants