aaron-bond / better-comments

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

Feature request: Exclude a particular language from the enables. #105

Open moriakijp opened 6 years ago

moriakijp commented 6 years ago

Many languages ​​are valid with // or / / comment style. So we only need to write "better-comment.tags" in settings.json once.

However, some languages ​​shouldn't to be effective. In order to remove it from the effective range, "better-comment.tags" will be written almost twice or more.

For example: //! WARNING RED shoud not be enabled for html default comment style .

So I thought that it would be nice to add feature to exclude a particular language.

aaron-bond commented 6 years ago

Hi @moriakijp, this sounds like a bug. // should not trigger a comment block in HTML. Only <!-- ! error --> should highlight.

Can you send a screenshot of the behavior you see?

moriakijp commented 6 years ago

Hi. @aaron-bond.

Appearances:

185

Added part in settings.json:

"better-comments.tags": [
    {
      "tag": "!",
      "color": "#6a9955",
      "strikethrough": false,
      "backgroundColor": "hsl(0, 100%, 10%)"
    },
    {
      "tag": "<",
      "color": "#6a9955",
      "strikethrough": false,
      "backgroundColor": "hsl(30, 100%, 10%)"
    },
    {
      "tag": ">",
      "color": "#6a9955",
      "strikethrough": false,
      "backgroundColor": "hsl(60, 100%, 10%)"
    },
    {
      "tag": "#",
      "color": "#6a9955",
      "strikethrough": false,
      "backgroundColor": "hsl(120, 100%, 10%)"
    },
    {
      "tag": "+",
      "color": "#6a9955",
      "strikethrough": false,
      "backgroundColor": "hsl(180, 100%, 10%)"
    },
    {
      "tag": "-",
      "color": "#6a9955",
      "strikethrough": false,
      "backgroundColor": "hsl(240, 100%, 10%)"
    },
    {
      "tag": "?",
      "color": "#6a9955",
      "strikethrough": false,
      "backgroundColor": "hsl(300, 100%, 10%)"
    },
    {
      "tag": "/",
      "color": "#6a9955",
      "strikethrough": true,
      "backgroundColor": "transparent"
    }
  ],

It is set to change only the background color.

Environment:

thanks.

aaron-bond commented 6 years ago

I'm not sure I understand. Your settings are using #6a9955 which is the green you see in the image above?

{
    "tag": "<",
    "color": "#6a9955",
    "strikethrough": false,
    "backgroundColor": "hsl(30, 100%, 10%)"
},

That's what's coloring your text green? What appearance are you looking to achieve?

moriakijp commented 6 years ago

Yes. That green is #6a9955 (which is default value of vscode theme).

I'm aiming to achieve the following state: [ General ] background is red. [ html ] background is nothing.

MrBlue commented 6 years ago

I think @moriakijp means something like this:

better-comments.excludeLanguages: {
  "html" : "<",
  "php" : ["!", "?"],
}

Where the key is the language and the string/array behind it is the tags you don't want to use in that language. With this example, the < tag won't be shown in html files and the ! and ? tags won't be shown in php files. The other tags will be shown just like normal.

aaron-bond commented 6 years ago

Ah! That would be an interesting feature... Is this what you're looking for @moriakijp?

moriakijp commented 6 years ago

Yes. it's nice proposal, @pim-moeskops shown what I'd like to meant.

FatehAK commented 5 years ago

Is this option available now? I can't see it in settings.json...

aaron-bond commented 5 years ago

No it hasn't been implemented yet. It's on the list though

FatehAK commented 5 years ago

Alright then thanks for the prompt reply

asheroto commented 2 years ago

+1 vote for this

In AutoHotkey you use certain syntax to indicate a hotkey to be used, and of course, with better-comments it makes this happen...

image

No biggie but would love to see this as an option in tags such as...

"better-comments.tags": [
    {
      "tag": "!",
      "color": "#6a9955",
      "strikethrough": false,
      "backgroundColor": "hsl(0, 100%, 10%)",
      "ignoredFileExtensions": [ "ahk" ]
    }
]

and also, live reload of the extension, or at least tab-reload reloading of the extension, would be awesome too!

mark-wiemer commented 2 months ago

Ref also #470