XamlStyler icon indicating copy to clipboard operation
XamlStyler copied to clipboard

Resharper Template: Error in StylerPackage

Open Prodigio opened this issue 5 years ago • 11 comments

Describe the bug On hitting save, the XAML Styler tries to format the template from Resharper

To Reproduce Steps to reproduce the behavior:

  1. Open the Template Explorer of Resharper
  2. Create a new template
  3. Write anything, doesn't matter.

Expected behavior I do not expect the XAML Styler to check this.

Screenshots If applicable, add screenshots to help explain your problem. image

Version Info (please complete the following information):

  • OS: Windows 10 Enterprise 2016 LTSB 64-bit (10.0, Build 14393)
  • Visual Studio: VS 2017 Version 15.9.22
  • XAML Styler: Version 3.2003.9

Prodigio avatar May 06 '20 13:05 Prodigio

Thanks for reporting this!

looks like this only happens when a XAML based solution is opened, I can't reproduce it when I have an ASP.net project open for example, but I can with WPF project open. We'll investigate!

NicoVermeir avatar May 06 '20 13:05 NicoVermeir

Any news on this one?

MarkSandy avatar May 10 '21 07:05 MarkSandy

thanks for the ping @MarkSandy unfortunately no news on this.

@maartenba do you have an idea why ReSharper template editor would trigger XAML Styler?

NicoVermeir avatar May 11 '21 09:05 NicoVermeir

Let me see if I can find anyone in the team who can shed some light on this...

maartenba avatar May 11 '21 14:05 maartenba

Looks like XamlStyler will have to do some additional checks on the document that is open. Probably with the debugger attached, check if any of your checks (e.g. these https://github.com/Xavalon/XamlStyler/blob/master/src/XamlStyler.Extension.Windows/Extensions/DocumentExtensions.cs) should be extended with additional conditions based on Document properties.

maartenba avatar May 12 '21 06:05 maartenba

I guess still no news on this?

I'm now running VS2022 and unfortunately I still epxerience it.

Just want to add, that even though the message box appears, the document itself get's saved. But it's annoying.

Prodigio avatar Feb 24 '22 08:02 Prodigio

Another thing I noticed: when saving all changes, not just per file, with shortcut CTRL + Shift + S the error does not appear.

Prodigio avatar Jul 20 '22 06:07 Prodigio

Very frustrating little bug here

xEsteem avatar Sep 26 '22 22:09 xEsteem

@maartenba could you help us out with a PR, after you nailed down the cause? Would really appreciate it!

Prodigio avatar Sep 27 '22 09:09 Prodigio

https://github.com/Xavalon/XamlStyler/issues/278#issuecomment-839497505 is what I was advised back then, not sure how though 😅

maartenba avatar Sep 28 '22 15:09 maartenba

Unfortunate. ;)

Prodigio avatar Sep 29 '22 05:09 Prodigio

Close, as it was solved by #453.

Prodigio avatar May 13 '24 09:05 Prodigio