mfractor / mfractor-feedback

Found a bug or have a feature request for MFractor? Submit it here!
3 stars 0 forks source link

When an element uses a style with inheritance, MFractor does not identify properties as redundant when provided by the parent style. #310

Closed JoacimWall closed 3 years ago

JoacimWall commented 3 years ago

hi if you have styles that are based on other styles in multiple steps you only get validation for the last step. I have removed start and end char in style to make this the post show correct.

Style: Style x:Key="LabelIconBaseStyle" TargetType="Label" Setter Property="HorizontalOptions" Value="Center" / Setter Property="VerticalOptions" Value="Center" / Setter Property="HorizontalTextAlignment" Value="Center" / Setter Property="VerticalTextAlignment" Value="Center" / Setter Property="FontFamily" Value="LiberoIconFont" / Setter Property="TextColor" Value="{StaticResource Primary500Color}" / /Style Style x:Key="LabelStyleIconFontXXLarge" BasedOn="{StaticResource LabelIconBaseStyle}" TargetType="Label" Setter Property="FontSize" Value="50" / /Style Style x:Key="LabelStyleIconFontXXLargeWhite" BasedOn="{StaticResource LabelStyleIconFontXXLarge}" TargetType="Label" Setter Property="TextColor" Value="{StaticResource WhiteColor}" / /Style

xaml: Label Grid.Row="0" HorizontalOptions="Center" VerticalOptions="Center" FontSize="50" TextColor="{StaticResource WhiteColor}" Style="{StaticResource LabelStyleIconFontXXLargeWhite}" Text="{StaticResource icon_article_library}" /

Mfratcor only says that TextColor is redundant but it's should say all except the text property.

Installation Information

--Platform Information--
Operating System: Mac
OS: Unix
OS Service Pack: 
OS Version: Unix 20.1.0.0
--MFractor Information--
Product Name: MFractor
Product Version: 4.4.2.0
Product Variant: Visual Studio Mac
Product Variant Version: 8.8.2.41
Product SKU: MFRACTOR-VS-MAC
Commit SHA: dea08f61041ba50eb9aa655b099a0addca130e68
Revision: 4675
Branch: master
Date: 29/11/2020 4:45:45 AM (UTC)
Agent: Local
Installed extensions:   'MFractor (4.4.2)', 'AddinMaker (1.5.0)', 'Multilingual Extension (1.0.20)', 'Refactoring Support (8.8.2)', 'JavaScript Debugger (8.8.2)', 'Azure Functions development (8.8.2)', 'Android development (8.8)', 'Web Project Support (8.8.2)', 'Visual Designer Support (8.8.2)', 'Test Runner (8.8.2)', 'Subversion core engine (8.8.2)', 'ILAsm Language Binding (8.8.2)', 'NuGet Packaging (8.8.2)', 'GTK# Visual Designer (8.8.2)', 'MonoDevelop Assembly Browser (8.8.2)', 'Git support (8.8.2)', 'CSharp Language Binding (8.8.2)', 'Project Web References (8.8.2)', 'Xamarin Test Cloud (8.8)', 'Xamarin Test Cloud - NUnit (8.8)', 'Android Deploy (16.8.0.507)', 'Version Control Support (8.8.2)', 'NUnit support (8.8.2)', 'Debugger support for MonoDevelop (8.8.2)', 'Mono Soft Debugger Support (8.8.2)', 'Xamarin Ide Identity (8.8.2)', 'Xamarin Hot Reload (1.0.0.4127551)', 'Text Templating (8.8.2)', 'NuGet Package Management (8.8.2)', 'Azure Support (8.8.2)', 'MonoDevelop Text Editor (8.8.2)', 'Xamarin Designer (16.8.0.507)', 'Web Editors (8.3)', 'Xamarin Terminal (8.8.2)', '.NET Core Support (8.8.2)', 'Xamarin Addins Core (8.8)', 'Container Tools (1.0.20200521.1)', 'Extension Developer Tools (8.8.2)', 'ConnectedServices (8.8.2)', 'Xamarin.Forms Previewer (16.8.0.507)', 'Android Designer (16.8.0.507)', 'Xamarin.Mac development (8.8)', 'Performance Diagnostics of IDE (8.8.2)', 'Unit Testing core support (8.8.2)', 'ChangeLog Add-in (8.8.2)', 'JavaScript and TypeScript (8.3)', 'Razor Language Services (8.0.20201102.3)', 'Xamarin Ide Extensions for Mac (8.8.2)', 'VisualFSharp (8.8.2)', 'Xamarin Ide Extensions (8.8.2)', 'Regex Toolkit (8.8.2)', 'MonoDevelop Mac Platform Support (8.8.2)', 'MonoDevelop Text Editor (8.8.2)', 'VsCode Debug Protocol support for MonoDevelop (8.8.2)', 'Deployment Services Core (8.8.2)', 'Forms Project Support (8.8)', 'Mac Development (8.8)', 'XamlLanguageService (16.8.0.507)', 'iOS development (8.8)', 'Visual Studio for Mac Tools for Unity (2.8.3.0)', 'Mono Soft Debugger Support for ASP.NET (8.8.2)', 'MonoDevelop Source Editor (8.8.2)', 'Gettext Translations Support (8.8.2)', 'Azure Mobile App Service (8.8)', 'MonoDevelop Hex Editor (8.8.2)', 'GDB Debugger Support (8.8.2)', 'Makefile generation (8.8.2)', 'iOS Designer (16.8.0.507)', 'Subversion support (8.8.2)', '.Net Core Debugger (8.8.2)', 'XML Editor (8.8.2)', 'VB.NET Language Binding (8.8.2)', 'ASP.NET Core Support (8.8.2)', 'Azure DevOps Authentication Support (8.8.2)'
matthewrdev commented 3 years ago

@JoacimWall Thanks for the excellent bug report! I'll investigate and aim to get a fix into MFractor 4.4.4

matthewrdev commented 3 years ago

@JoacimWall From what I can see in the provided XAML and from my local testin, MFractor is evaluating and reporting this correctly.

The Label in the provided sample uses the LabelStyleIconFontXXLargeWhite, which overrides the TextColor property and sets it to {StaticResource WhiteColor}. The Label then also defines TextColor as {StaticResource WhiteColor}.

Please see reproduction below: image

JoacimWall commented 3 years ago

Hi Mfractor/Mfractor-Feedback The issue I was referring to is that if i add style and also set the TextColor="ColorWhite" mfractor highlights the i can remove TextColor="ColorWhite" as it already is in the style. but if i add VerticalOptions="Center" Mfractor don't highlight that i can remove it as it already in the style(Parent style).

//Regards Joacim Wall

On Tue, 8 Dec 2020 at 09:29, Matthew Robbins notifications@github.com wrote:

@JoacimWall https://github.com/JoacimWall From what I can see in the provided XAML and from my local testin, MFractor is evaluating and reporting this correctly.

The Label in the provided sample uses the LabelStyleIconFontXXLargeWhite, which overrides the TextColor property and sets it to {StaticResource WhiteColor}. The Label then also defines TextColor as {StaticResource WhiteColor}.

Please see reproduction below: [image: image] https://user-images.githubusercontent.com/3260473/101458943-4b320380-3983-11eb-9843-35e3c82d8685.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mfractor/mfractor-feedback/issues/310#issuecomment-740467657, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACGZLPBTZR2QR6HCHI4SBCDSTXPYJANCNFSM4UOMWSLQ .

matthewrdev commented 3 years ago

Ah, thanks for clarifying. I've misunderstood the issue.

matthewrdev commented 3 years ago

@JoacimWall Thanks for reporting the issue, I've tracked down the source of it and have now resolved it. This will be in MFractor 4.4.4, released today (AEST timezone).

image