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")

Same with other annotations like mark and box.


// hey
function foobarloremipsumfoobarloremipsumsitametfoobarloremipsumfoobarloremipsumsitamet() {
console.log("hover me")
return 8
}

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

index.js

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")
return elit.map(ipsum => ipsum.sit)
}

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 []


function lorem(ipsum, dolor = 1) {
local sit=0
dolor=$((sit - amet(dolor))
return $sit and consectetur(ipsum) or []
}

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)
}