Skip to content

Commit

Permalink
Don't output to Output Panel when setting is enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
mt40 committed Aug 5, 2017
1 parent 56024ac commit 2f83a30
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,6 @@
## 1.9.1
- Fix issue 68: the extension still outputs to Output Panel when the setting `showInProblems` is enabled.

## 1.9.0
- Add option to show TODOs in PROBLEMS panel of VSCode instead. (from #65)
- When reading, does not reject all files in batch whenever a file failed to load. (from #66)
Expand Down
Binary file added built_packages/vscode-todo-parser-1.9.1.vsix
Binary file not shown.
20 changes: 14 additions & 6 deletions package.json
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-todo-parser",
"displayName": "TODO Parser",
"description": "Parse TODOs in your working files.",
"version": "1.9.0",
"version": "1.9.1",
"publisher": "minhthai",
"engines": {
"vscode": "^1.2.0"
Expand Down Expand Up @@ -51,7 +51,10 @@
"type": "array",
"description": "An array of words that signal the start of TODOs, or tuples containig the words and their priorities.",
"items": {
"type": ["string", "array"],
"type": [
"string",
"array"
],
"description": "Word that signals the start of a TODO comment, or a tuple of the word and comment priority.",
"items": [
{
Expand All @@ -60,10 +63,14 @@
},
{
"enum": [
"Error", 0,
"Warning", 1,
"Information", 2,
"Hint", 3
"Error",
0,
"Warning",
1,
"Information",
2,
"Hint",
3
],
"description": "The priority level of the TODO comment. Determines how the TODO item is rendered in the Problems panel"
}
Expand Down Expand Up @@ -91,6 +98,7 @@
"dependencies": {
"chance": "^1.0.4",
"fs-extra": "^0.30.0",
"typescript": "^1.8.10",
"typescript-collections": "^1.1.2"
},
"license": "SEE LICENSE IN LICENSE"
Expand Down
20 changes: 13 additions & 7 deletions src/classes/OutputWriter.ts
Expand Up @@ -40,13 +40,17 @@ export class OutputWriter {
static finish(todoCount: number) {
assert(OutputWriter.state === State.Busy, "There is no work to finish.");

const showInProblems = UserSettings.getInstance().ShowInProblems.getValue();

let channel = OutputWriter.outputChannel;
if (todoCount == 0)
channel.appendLine('No TODOs found.');
else {
channel.appendLine('==================================');
let unit = (todoCount > 1) ? 'TODOs' : 'TODO';
channel.appendLine(`Found ${todoCount} ${unit}.\n`);
if(!showInProblems) {
if (todoCount == 0)
channel.appendLine('No TODOs found.');
else {
channel.appendLine('==================================');
let unit = (todoCount > 1) ? 'TODOs' : 'TODO';
channel.appendLine(`Found ${todoCount} ${unit}.\n`);
}
}

OutputWriter.state = State.Idle;
Expand Down Expand Up @@ -104,8 +108,10 @@ export class OutputWriter {
}

private static showPanel() {
const showInProblems = UserSettings.getInstance().ShowInProblems.getValue();
let channel = OutputWriter.outputChannel;
if(OutputWriter.state === State.Idle) {

if(!showInProblems && OutputWriter.state === State.Idle) {
channel.clear();
channel.show(true);
}
Expand Down

0 comments on commit 2f83a30

Please sign in to comment.