Debug

Comment annotations

Instead of defining the focus on the codeblock metastring, you can us comments inside the code to make the focus relative.

function lorem(ipsum, dolor = 1) {
const sit = ipsum == null && 0
dolor = sit - amet(dolor)
return sit ? consectetur(ipsum) : []
}

function adipiscing(...elit) {
console.log(elit)
return elit.map(ipsum => ipsum.sit)
}

console.log("hey")
Copy

Same with other annotations like mark and box.

function foo() {
console.log("hover me")
return 8
}
Copy

You can pass a string parameter to comment annotations. For mark and box, it will be used as a color.

index.js
Copy
function lorem(ipsum, dolor = 1) {
const sit = ipsum == null && 0
dolor = sit - amet(dolor)
return sit ? consectetur(ipsum) : []
}

// this comment isn't an annotation
//hello
// 你好
// å
function adipiscing(...elit) {
console.log(elit)
return elit.map(ipsum => ipsum.sit)
}

And now we introduce two more annotations: link and label

function lorem(ipsum, dolor = 1) {
const sit = ipsum == null && 0
dolor = sit - amet(dolor)
return sit ? consectetur(ipsum) : []
}

function adipiscing(...elit) {
console.log("hover me")
something something
return elit.map(ipsum => ipsum.sit)
}
Copy

Bash like comments

def lorem(ipsum, dolor = 1):
sit = ipsum == None and 0
# this isn't an annotation
# 你好
dolor = sit - amet(dolor)
return sit and consectetur(ipsum) or []
Copy
function lorem(ipsum, dolor = 1) {
local sit=0
dolor=$((sit - amet(dolor)))
something something
return $sit and consectetur(ipsum) or []
}
Copy

With class

function lorem(ipsum, dolor = 1) {
const sit = ipsum == null && 0
dolor = sit - amet(dolor)
return sit ? consectetur(ipsum) : []
}

function adipiscing(...elit) {
console.log("hover me")
return elit.map(ipsum => ipsum.sit)
}
Copy