How to refactor a method signature in DVT IDE for VS Code
Overview
This video shows how you can easily add, remove and reorder the arguments of a function or task in DVT IDE for VS Code.
This video was made using DVT IDE version 25.3.22 and VS Code 1.107.
Details
Introduction
In DVT IDE, you can easily add, remove, and reorder the arguments of a function or task.
Changing the Method Signature
Place the editor cursor on a method name, either on its declaration or on a method call.
Then run the Refactor command and choose Change Function Signature from the pop-up list.
In the dialog that pops up, click Add and specify the new argument's type, name and the value to be used in existing calls.
Use the Up and Down buttons to move the arguments.
Previewing the Changes
You can choose to Preview the changes about to be performed or click OK to apply them. Let's take a look at the preview.
Note that the changes will be performed both in the extern declaration and in the out-of-body implementation of the function, and all existing function calls will be updated as well.
Handling Overrides in Subclasses
Now let's take another example.
Note that this task has two overrides in UART monitor subclasses. Let's remove one of its arguments.
Note that all task declarations across the whole object-oriented inheritance tree, as well as the task calls, were automatically updated.