Skip to content
This repository was archived by the owner on Apr 30, 2021. It is now read-only.

Commit 4beea73

Browse files
committed
Fixed duplicate diagnostics
1 parent d7099c0 commit 4beea73

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## 0.8.2 - Sep 14, 2018
4+
- [Hotfix] Duplicate diagnostics were showing up in problems panel. Fixed this in this patch.
5+
36
## 0.8.1 - Sep 13, 2018
47
- [Hotfix] Added settings to hide either of the diagnostics or error annotations
58

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vscode-js-annotations",
33
"displayName": "JS Parameter Annotations",
44
"description": "Annotations for parameters in your JS / TS Files to mimic named parameters",
5-
"version": "0.8.1",
5+
"version": "0.8.2",
66
"publisher": "lannonbr",
77
"engines": {
88
"vscode": "^1.25.0"

src/extension.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@ async function run(ctx: vscode.ExtensionContext, editor: vscode.TextEditor | und
5252
}
5353

5454
// Setup variables for diagnostics when loading JS file
55-
if (editor.document.languageId === "javascript") {
55+
if (diagCollection === undefined && editor.document.languageId === "javascript") {
5656
diagCollection = vscode.languages.createDiagnosticCollection("js-annot");
57-
diagnostics = [];
5857
}
5958

6059
const isEnabled = vscode.workspace.getConfiguration("jsannotations").get("enabled");

src/test/extension.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ suite("js annotations", () => {
4040
const [decArray, errDecArray] = await Extension.createDecorations(editor, editor.document.getText());
4141

4242
assert.deepEqual(decArray.length, 1);
43-
assert.deepEqual(errDecArray.length, 1);
43+
44+
// By Default the error decoration is hidden with the diagnostic in it's place
45+
// TODO: Check for diagnostic
46+
assert.deepEqual(errDecArray.length, 0);
4447

4548
vscode.commands.executeCommand("workbench.action.closeActiveEditor");
4649
});

0 commit comments

Comments
 (0)