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

Commit 72ae33e

Browse files
authored
Merge pull request #69 from romap0:hide-first-space
Option to disable leading whitespace for first parameter
2 parents ffe0b6e + 918d708 commit 72ae33e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@
7878
"italic"
7979
],
8080
"description": "Annotation styling of font-style CSS property"
81+
},
82+
"jsannotations.showFirstSpace": {
83+
"type": "boolean",
84+
"description": "Show leading whitespace for first parameter",
85+
"default": true
8186
}
8287
}
8388
}

src/decorator.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ export async function decorateFunctionCall(currentEditor: vscode.TextEditor, doc
7979

8080
continue;
8181
}
82-
const spacer = (counter === 0) ? " " : "";
82+
83+
const showFirstSpace = vscode.workspace.getConfiguration("jsannotations").get("showFirstSpace");
84+
const spacer = (counter === 0 && showFirstSpace) ? " " : "";
8385
decoration = Annotations.paramAnnotation(spacer + paramList[idx] + ": ", currentArgRange);
8486
}
8587
counter++;

0 commit comments

Comments
 (0)