Top Method Summary
Options Name Purpose
InsertAfterNode (INode, character) Inserts the given text before the given INode
InsertBeforeNode (INode, character, logical) Inserts the given text before the given JPNode
InsertRefactorTask (integer, integer, character, logical) Registers a location in the source for replacement
PerformRefactor () Performs the modifications of the file contents
RemoveNodeRange (INode, INode) Removes everything between two nodes, inclusive
ReplaceAllNodeContent (INode, character) Replaces the contents of the given INode instance including all it's Children
ReplaceNodeContent (INode, character) Replaces the contents of the given INode instance
ReplaceNodeRangeContent (INode, INode, character) Replaces everything between two nodes, inclusive, with the given text
LOGICAL Save () Saves the contents of the RefactorSession to the original file name
LOGICAL Save (character) Saves the contents of the RefactorSession to a file

Top Constructor Summary
Options Name Purpose
RefactorSession2 (IParseUnit) Constructor for the RefactorSession2 class

Top Property Summary
Options Name Purpose
CHARACTER FileName
LOGICAL HasTasks
Consultingwerk.Studio.ProparseApi.IParseUnit ParseUnit
LOGICAL Refactored


Method Detail
Top

InsertAfterNode (INode, character)

Purpose: Inserts the given text before the given INode
Notes:

Parameters:
poNode Consultingwerk.Studio.ProparseApi.INode
The INode to replace
pcNewText CHARACTER
The new text for the node
Top

InsertBeforeNode (INode, character, logical)

Purpose: Inserts the given text before the given JPNode
Notes:

Parameters:
poNode Consultingwerk.Studio.ProparseApi.INode
The INode to replace
pcNewText CHARACTER
The new text for the node
plStartOfLine LOGICAL
Logical value indicating if the text should be inserted at the beginning of the line or just before the JPNode position
Top

InsertRefactorTask (integer, integer, character, logical)

Purpose: Registers a location in the source for replacement
Notes:

Parameters:
piOffsetFrom INTEGER
The starting offset to replace
piOffsetTo INTEGER
The ending offset to replace
pcNewText CHARACTER
The new text to insert
plReplaceOrInsert LOGICAL
Logical value if text should be replace the offset (true) or be inserted at the offset (false)
Top

PerformRefactor ()

Purpose: Performs the modifications of the file contents
Notes:

Top

RemoveNodeRange (INode, INode)

Purpose: Removes everything between two nodes, inclusive
Notes: SCL-5825: When the range is the only code on its lines - only
whitespace precedes the first node on its line and follows the
last node on its line - the lines are removed as a whole,
including their line breaks, so that removing a statement does
not leave a blank line with trailing whitespace behind. When
other code shares a line with the range, only the range itself
is removed.
As with ReplaceNodeRangeContent, both nodes have to carry a
source position

Parameters:
poFromNode Consultingwerk.Studio.ProparseApi.INode
The first node of the range
poToNode Consultingwerk.Studio.ProparseApi.INode
The last node of the range
Top

ReplaceAllNodeContent (INode, character)

Purpose: Replaces the contents of the given INode instance including all it's
Children
Notes:

Parameters:
poNode Consultingwerk.Studio.ProparseApi.INode
The INode to replace
pcNewText CHARACTER
The new text for the node
Top

ReplaceNodeContent (INode, character)

Purpose: Replaces the contents of the given INode instance
Notes:

Parameters:
poNode Consultingwerk.Studio.ProparseApi.INode
The INode to replace
pcNewText CHARACTER
The new text for the node
Top

ReplaceNodeRangeContent (INode, INode, character)

Purpose: Replaces everything between two nodes, inclusive, with the given text
Notes: SCL-5678: Replacing a statement node by node leaves the
whitespace *between* the tokens behind - that whitespace belongs
to no node, so clearing the node texts one at a time cannot
remove it. Replacing the whole span in a single task does, which
is what a caller rewriting a complete statement needs.
Both nodes have to carry a source position; a synthetic node
(line 0 / column 0, e.g. an Expr_statement or a Method_param_list)
is not a valid boundary - use its first / last positioned
descendant instead

Parameters:
poFromNode Consultingwerk.Studio.ProparseApi.INode
The first node of the range
poToNode Consultingwerk.Studio.ProparseApi.INode
The last node of the range
pcNewText CHARACTER
The text replacing the whole range
Top

LOGICAL Save ()

Purpose: Saves the contents of the RefactorSession to the original file name
Notes:

Returns LOGICAL
Logical value indicating the success of the method
Top

LOGICAL Save (character)

Purpose: Saves the contents of the RefactorSession to a file
Notes:

Parameters:
pcFileName CHARACTER
The name of the file to save to
Returns LOGICAL
Logical value indicating the success of the method


Constructor Detail
Top

RefactorSession2 (IParseUnit)

Purpose: Constructor for the RefactorSession2 class
Notes:

Parameters:
poParseUnit Consultingwerk.Studio.ProparseApi.IParseUnit
The ProParse Unit to refactor


Property Detail
Top

CHARACTER FileName


Returns CHARACTER
Top

LOGICAL HasTasks


Returns LOGICAL
Top

Consultingwerk.Studio.ProparseApi.IParseUnit ParseUnit


Returns Consultingwerk.Studio.ProparseApi.IParseUnit
Top

LOGICAL Refactored


Returns LOGICAL


©2006-2026 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       19.09.2026 10:18:51