aaron-bond / better-comments

https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments
MIT License
839 stars 163 forks source link

Use ! ? as tags only if followed by white space #480

Closed khanybaba closed 1 year ago

khanybaba commented 1 year ago

In JS the ! is the logical not operator it is not uncommon to find a ternary statement of the form !variable ? execute_this : execute_that when commenting such a line of code Better Comments takes the initial exclamation mark to be a tag requiring (or providing an optional setting that will require) a tag to be followed by whitespace will prevent these commented lines from being incorrectly tagged

porg commented 1 year ago

Your desired customization is already possible now

  1. Open Settings (⌘ , on a Mac)
  2. Search for "Better Comments". Click on: Extensions → Better Comments.
  3. Tags: [Edit in settings.json]() 👉 Click that link to open the settings file
    • Find the array "better-comments.tags": (currently on line 31)
    • Find "tag": "!", (currently on line 35) and change it to "tag": "! ", (space character after the exclamation mark)
  4. Restart VSCode.

✅ From now on that style is only applied to comment lines starting with !.

Did that solve your issue? If so you may close the issue.

khanybaba commented 1 year ago

Thank you. Much appreciated!