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

Allow short member names for static resolvers #145

Merged
merged 1 commit into from
Nov 8, 2023
Merged

Allow short member names for static resolvers #145

merged 1 commit into from
Nov 8, 2023

Conversation

Govorunb
Copy link
Contributor

@Govorunb Govorunb commented Nov 7, 2023

Changes static resolvers to attempt to resolve on the property's owner type if given a member name without the . separator.

This adds a bit of QoL by removing the need to fully qualify the name of the static member if it's being referenced by a property under the exact same type.

For example:

namespace Some.Long.Namespace
{
    public class Example : ScriptableObject
    {
        // old
        // [Dropdown("Some.Long.Namespace.Example.GetDropdown")
        // new
        [Dropdown(nameof(GetDropdown))]
        public string example;

        private static TriDropdownList<string> GetDropdown()
        {
            // ...
        }
    }
}

Removes the need to fully qualify the name of the static member if it's being referenced from a property under the exact same type
@vanifatovvlad vanifatovvlad merged commit 86fed7a into codewriter-packages:main Nov 8, 2023
@Govorunb Govorunb deleted the short-names-for-static-resolvers branch July 5, 2024 05:36
@Govorunb Govorunb restored the short-names-for-static-resolvers branch July 5, 2024 05:36
@Govorunb Govorunb deleted the short-names-for-static-resolvers branch July 5, 2024 05:36
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.

2 participants