kisstkondoros / codemetrics

VSCode extension which shows the complexity information for TypeScript class members
Other
404 stars 20 forks source link

Arrow disable not work correct #66

Closed Mordef closed 5 years ago

Mordef commented 5 years ago

Like #62 in TS-File grafik

Settings: "codemetrics.nodeconfiguration.ArrowFunction": 0,

Also for Funtion needed or how can i fix something like this: foo.addEventListener('click', function (event) { _this.dosomething(event); });

kisstkondoros commented 5 years ago

Thanks for reaching out!

1: To hide the code lens over arrow functions : MetricsForArrowFunctionsToggled: false or use the Toggle code lenses for arrow functions command

2: foo.addEventListener('click', function (event) { _this.dosomething(event); }); is equivalent with

var handler = function (event) { _this.dosomething(event); }
foo.addEventListener('click', handler);

which is the same (functionality wise, in this example) as

var handler = _this.dosomething.bind(_this);
foo.addEventListener('click', handler);
Mordef commented 5 years ago

Thanks for fast answer