It is the same process, but you will want to enable
tool mode, and be careful how you write the tool code by checking the editor hint flag.
Here's a basic example, you'll notice it draws to the canvas item of the node only in the editor. I used continuous update in the event you want to change the vector and have it redrawn, you should change that to meet your conditions.
onready var in_editor = get_tree().is_editor_hint()
var A = Vector2()
var B = Vector2(100, 100)
draw_line(A, B, Color(1,1,1), 3)