Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

adds the ability to show code coverage via the gutter #509

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions lib/tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,21 @@ class Tester {
}
}
}
editor.decorateMarkerLayer(coveredLayer, {type: 'highlight', class: 'covered', onlyNonEmpty: true})
editor.decorateMarkerLayer(uncoveredLayer, {type: 'highlight', class: 'uncovered', onlyNonEmpty: true})

let type = atom.config.get("go-plus.test.coverageDisplayMode")
switch(type){
case "gutter":
type = "line-number"
break
case "highlight":
type = "highlight"
break
default:
type = "highlight"
}

editor.decorateMarkerLayer(coveredLayer, {type: type, class: 'covered', onlyNonEmpty: true})
editor.decorateMarkerLayer(uncoveredLayer, {type: type, class: 'uncovered', onlyNonEmpty: true})
} catch (e) {
console.log(e)
}
Expand Down
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,23 @@
],
"order": 3
},
"coverageDisplayMode": {
"title": "Coverage Display Mode",
"description": "Control the way that coverage is displayed in the editor: gutter, or highlight",
"type": "string",
"default": "highlight",
"enum":[
"highlight",
"gutter"
],
"order": 4
},
"focusPanelIfTestsFail": {
"title": "Focus The go-plus Panel If Tests Fail",
"description": "If the panel is hidden, or the panel is showing a different tab, the panel will be expanded and the test tab focused when tests fail.",
"type": "boolean",
"default": true,
"order": 4
"order": 5
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions styles/go-plus-test.atom-text-editor.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@
background-color: @background-color-success;
opacity: 0.2;
}

.line-number.uncovered{
background-color: @background-color-error;
}

.line-number.covered{
background-color: @background-color-success;
}