papyrus-lang icon indicating copy to clipboard operation
papyrus-lang copied to clipboard

Refactoring with "Rename Symbol" doesnt work as intended with states or inheritance.

Open Scrivener07 opened this issue 5 years ago • 1 comments

Describe the bug Refactoring of functions and events with "Rename Symbol" doesnt work as intended with states or inheritance.

To Reproduce In this example, all Foobar() functions should have changed. derpy

Scriptname ChildType extends BaseType

Event OnQuestInit()
	Foobar(true)
	Debug.TraceSelf(self, "OnQuestInit", "Player:" + Player)
EndEvent

var Function Foobar(var argument)
	return "Child"
EndFunction

State DerpState
	var Function Foobar(var argument)
		return "Child Derp"
	EndFunction
EndState
ScriptName BaseType extends Quest Native Const Hidden

Actor Property Player Auto Const Mandatory

var Function Foobar(var argument)
	return "Base"
EndFunction

State DerpState
	var Function Foobar(var argument)
		return "Base Derp"
	EndFunction
EndState

Scrivener07 avatar Jun 25 '19 13:06 Scrivener07

I just noticed that my BaseType is not valid to compile. Auto properties and variables are not allowed on Native flagged scripts. I was moving things around to test refactoring and didnt compile in this case.

This doesnt affect the issue at hand though I bring it up in case you try to test the sample code. Just move the property into ChildType to correct this. This comment can otherwise be ignored.

Scrivener07 avatar Jul 17 '19 04:07 Scrivener07