kisstkondoros / codemetrics

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

fix: Compatible with type, lang, setup in scirpt #116

Closed hancao97 closed 10 months ago

hancao97 commented 11 months ago
  1. Reduced regular expression
  2. Compatible with type, lang, setup in scirpt
hancao97 commented 11 months ago

First, the regular expression for extracting script tags in Vue files has been simplified, and a bug that prevented the correct calculation of complexity when the script contained attributes like "type" has been fixed.

kisstkondoros commented 11 months ago

This way the offsets are broken. The replacement must match the length of the original text.