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

Commit 15cf9a6

Browse files
committed
Fixing issue where TS casted params were causing issues
1 parent 5380ce7 commit 15cf9a6

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
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.9.1 - Oct 16, 2018
4+
- [Bug] TS casted params were incorrectly annotated by one column.
5+
36
## 0.9.0 - Sep 29, 2018
47
- [Feature] Annotations will now be added / remove in real time without needing to save.
58
- [Hotfix] Fixed CI breaking

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.9.0",
5+
"version": "0.9.1",
66
"publisher": "lannonbr",
77
"engines": {
88
"vscode": "^1.25.0"

src/parser.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ function parseParams(args: any, editor: vscode.TextEditor): any {
131131
const startArr = [start.line - 1, start.column];
132132
const endArr = [end.line - 1, end.column];
133133

134+
// TSTypeAssertions are off by one for some reason so subtract the column by one.
135+
if (arg.type === "TSTypeAssertion") {
136+
startArr[1] -= 1;
137+
}
138+
134139
const line = editor.document.lineAt(startArr[0]);
135140

136141
let offset;

0 commit comments

Comments
 (0)