Skip to content

Commit

Permalink
Fixes #109
Browse files Browse the repository at this point in the history
  • Loading branch information
swr1bm86 committed May 27, 2017
1 parent cdc6d99 commit 1a0aa2f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ The following Visual Studio Code settings along with their *default* values that

```javascript
{
"idris.executablePath": "idris", // The full path to the idris executable.
"idris.hoverMode": "fallback", // Controls the hover behavior. 'info' will display Idris documentation, 'type' will display Idris type, 'fallback' will try 'info' first and fallback to 'type' if we can not get the documentation, and 'none' will disable hover tooltips.
"idris.suggestMode": "allWords" // Controls the auto-completion behavior. 'allWords' will always include all words from the currently opened documentation, 'replCompletion' will get suggestions from Idris REPL process.
"idris.warnPartial": true // Show warning when a function is partial.
"idris.executablePath": "idris", // The full path to the idris executable.
"idris.hoverMode": "fallback", // Controls the hover behavior. 'info' will display Idris documentation, 'type' will display Idris type, 'fallback' will try 'info' first and fallback to 'type' if we can not get the documentation, and 'none' will disable hover tooltips.
"idris.suggestMode": "allWords" // Controls the auto-completion behavior. 'allWords' will always include all words from the currently opened documentation, 'replCompletion' will get suggestions from Idris REPL process.
"idris.warnPartial": false // Show warning when a function is partial.
"idris.showOutputWhenTypechecking": false //Show output channel when typechecking finished."
}
```

Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
},
"idris.warnPartial": {
"type": "boolean",
"default": true,
"default": false,
"description": "Show warning when a function is partial."
},
"idris.hoverMode": {
Expand All @@ -120,6 +120,11 @@
],
"default": "allWords",
"description": "Controls the auto-completion behavior. 'allWords' will always include all words from the currently opened documentation, 'replCompletion' will get suggestions from Idris REPL process."
},
"idris.showOutputWhenTypechecking": {
"type": "boolean",
"default": false,
"description": "Show output channel when typechecking finished."
}
}
},
Expand Down
17 changes: 12 additions & 5 deletions src/idris/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,13 @@ let buildIPKG = (uri) => {
}

let typecheckFile = (uri) => {
let needShowOC = vscode.workspace.getConfiguration('idris').get('showOutputWhenTypechecking')
let successHandler = (_) => {
outputChannel.clear()
outputChannel.show()
outputChannel.append("Idris: File loaded successfully")
if (needShowOC) {
outputChannel.clear()
outputChannel.show()
outputChannel.append("Idris: File loaded successfully")
}
tcDiagnosticCollection.clear()
typeCheckingStatusItem.text = "Idris: Type checking ✔︎"
typeCheckingStatusItem.show()
Expand All @@ -224,9 +227,13 @@ let typecheckFile = (uri) => {
return arg.responseType === 'return'
}).subscribe(successHandler, (err) => {
destroy(true)
displayErrors(err)
if (needShowOC) {
displayErrors(err)
}
})
showLoading()
if (needShowOC) {
showLoading()
}
resolve()
}).then(function () {
}).catch(function () {
Expand Down

0 comments on commit 1a0aa2f

Please sign in to comment.