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.
tool
extends Node2D
onready var in_editor = get_tree().is_editor_hint()
func _ready():
if(in_editor):
set_fixed_process(true)
func _fixed_process(delta):
update()
var A = Vector2()
var B = Vector2(100, 100)
func _draw():
if(in_editor):
draw_line(A, B, Color(1,1,1), 3)