language extension - How to customize comment block characters in visual studio code? -


i created language extension visual studio code , change comment block characters couldn't find way so..

has done or know how it?

ok, figured out problem. there 2 ways can change comment blocks:

1 - config file

i dont know why it's not in docs (or @ least couldn't find it) there optional property pass object inside contributes.languages array in package.json named configuration.

the description found on vs code source code:

a relative path file containing configuration options language.

on files can create object 1 , it's gonna overwrite default comment characters

{   "comments": {     "linecomment": "//",     "blockcomment": [ "<!--", "-->" ]   } } 

you can see properties on api references: https://code.visualstudio.com/docs/extensionapi/vscode-api#commentrule

note: comment block command triggered different shortcut. can overwrite though (in general or specific language using property when on key binding object).

⇧⌥a - toggle block comment - editor.action.blockcomment https://code.visualstudio.com/docs/customization/keybindings

2 - "syntax" file .tmlanguage

yes, can there , can make better. can see example here https://github.com/andrejunges/vscode-handlebars/blob/master/syntaxes/handlebars.tmlanguage#l68


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -