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

Fix intellisense attached property type mix match #336

Conversation

workgroupengineering
Copy link
Contributor

To simulate the issue, install the latest build from the repository and try adding any Grid.Column element, you can see that Intellisense proposes True/False.

The behavior depends on this fragment

foreach (var methodDef in typeDef.Methods)
{
if (methodDef.Name.StartsWith("Set", StringComparison.OrdinalIgnoreCase) && methodDef.IsStatic && methodDef.IsPublic
&& methodDef.Parameters.Count == 2)
{
setMethod = methodDef;
}
if (methodDef.IsStatic
&& methodDef.Name.StartsWith("Get", StringComparison.OrdinalIgnoreCase)
&& methodDef.IsPublic
&& methodDef.Parameters.Count == 1
&& !string.IsNullOrEmpty(methodDef.ReturnTypeFullName)
)
{
getMethod = methodDef;
}
}

which returns the first static methods initialed by Set or Get instead of checking the full name.

This lines:

https://github.com/workgroupengineering/AvaloniaVS/blob/087973fd16142f327131f0107fb1bce73c0bd8e5/CompletionEngine/Avalonia.Ide.CompletionEngine/AssemblyMetadata/MetadataConverter.cs#L557-L566

is adding for check currect retutn type in test.

@@ -267,15 +267,18 @@ public static Metadata ConvertMetadata(IMetadataReaderSession provider)
IMethodInformation? setMethod = null;
IMethodInformation? getMethod = null;

var setMenthdName = $"Set{name}";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo Menthd -> Method?

@maxkatz6 maxkatz6 merged commit 423ab70 into AvaloniaUI:master Jun 9, 2023
@workgroupengineering workgroupengineering deleted the fixes/Intellisense/AttachedProperty branch June 9, 2023 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants