Skip to content

Allow short member names for static resolvers#145

Merged
vanifatovvlad merged 1 commit into
codewriter-packages:mainfrom
Alexejhero:short-names-for-static-resolvers
Nov 8, 2023
Merged

Allow short member names for static resolvers#145
vanifatovvlad merged 1 commit into
codewriter-packages:mainfrom
Alexejhero:short-names-for-static-resolvers

Conversation

@Govorunb
Copy link
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

2 participants