pull_up
Move a method or field up into its superclass and remove it from the declaring subclass. Position on the member name; requires load_project first and returns text edits to apply.
Instructions
Pull a method or field up into the superclass and remove it from the declaring subclass.
USAGE: Position on the member name in the subclass. OUTPUT: editsByFile covering the superclass (member added) and the subclass (member removed); warnings from JDT's condition checking, by the place each names (file, then position; those naming one place in JDT's order, those naming none last). Edits are returned as text - apply them yourself.
The superclass is the Java model's, for local and anonymous classes in and after lambda bodies too. A member is refused when JDT's own type hierarchy leaves that superclass out (a class declared in a lambda body, a local class read by the handle of another of the same name), naming it: JDT's pull up would act on another class. A member is also refused when the superclass has a subclass declared in a lambda body, naming it: JDT's pull up cannot read that class. And a member is refused when JDT's own type hierarchy of the superclass does not hold every subtype with source as the Java model does (a class declared in a lambda body at any depth, a local class held by the handle of another of the same name), naming each type it leaves out and each it holds that is no subtype: JDT's pull up reads the subtypes from that hierarchy.
IMPORTANT: Uses ZERO-BASED coordinates.
Requires load_project to be called first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Zero-based line number of the member declaration | |
| column | Yes | Zero-based column number (on the member name) | |
| filePath | Yes | Path to source file containing the member |