better-comments icon indicating copy to clipboard operation
better-comments copied to clipboard

Feature request: Exclude a particular language from the enables.

Open moriakijp opened this issue 6 years ago • 12 comments

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.

moriakijp avatar Sep 28 '18 07:09 moriakijp

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?

aaron-bond avatar Sep 28 '18 08:09 aaron-bond

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:

  • Editor: VScode Version 1.27.2 (1.27.2)
  • Theme: Dark+ (default dark)

thanks.

moriakijp avatar Sep 28 '18 22:09 moriakijp

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?

aaron-bond avatar Sep 30 '18 11:09 aaron-bond

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.

moriakijp avatar Oct 03 '18 01:10 moriakijp

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.

MrBlue avatar Oct 03 '18 07:10 MrBlue

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

aaron-bond avatar Oct 03 '18 08:10 aaron-bond

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

moriakijp avatar Oct 06 '18 02:10 moriakijp

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

FatehAK avatar May 16 '19 17:05 FatehAK

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

aaron-bond avatar May 16 '19 17:05 aaron-bond

Alright then thanks for the prompt reply

FatehAK avatar May 16 '19 17:05 FatehAK

+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!

asheroto avatar Sep 18 '22 23:09 asheroto