String suggestions in Unity
Working with strings in unity can be a bit annoying, which is why I like that the Unity plugin has functionality to suggest strings when working in Rider. But it only suggests it sometimes and I would like to know if there is any way I can extend that. For example:
I'm trying to make a scene loading method since I want to do some more stuff in relation to scene loading. When I use SceneManager.LoadSceneAsync() I get suggestions on all the scenes in the project but their name as a string. But when I pass it in as a parameter in my method I do not, so extending that functionality to my method would be preferable.
Is there any way to do this or is this something that is locked within the plugin? If it's not available I hope that they will add support for it in the future!
Please sign in to leave a comment.
Hello, could you please add couple examples to demonstrate the desired result? Thank you in advance!
Since Unity often use strings to identify elements in the project (and since that is very easy to accidentally misspell) it's really nice when Rider lists them. But that function seems to be tied to the specific Unity function (top image). It would be nice to be able to extend this functionality to other parts of the code as well (bottom image). I looked around to see if this was already possible but I couldn't find anything.
Unfortunately, this is limited to only known Unity APIs, and not currently extensible to user APIs. I've added a feature request at JetBrains/resharper-unity#2115 to look at making this more extensible.
Thank you!