Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to the Power Users community on Codidact!

Power Users is a Q&A site for questions about the usage of computer software and hardware. We are still a small site and would like to grow, so please consider joining our community. We are looking forward to your questions and answers; they are the building blocks of a repository of knowledge we are building together.

Post History

66%
+2 −0
Q&A How to change default comment char for INI in VS Code?

You can't edit it in settings, but I do know where those come from. It's in language-configuration.json, under comments: Comment toggling VS Code offers two commands for comment toggling. Toggl...

posted 3mo ago by Michael‭  ·  edited 3mo ago by Michael‭

Answer
#3: Post edited by user avatar Michael‭ · 2024-09-12T13:14:37Z (3 months ago)
Look, someone else made a way to manage it.
  • I don't know if you can edit it in settings, but I do know where those come from. It's in `language-configuration.json`, under `comments`:
  • > ## [Comment toggling][docs]
  • > VS Code offers two commands for comment toggling. **Toggle Line Comment** and **Toggle Block Comment**. You can specify `comments.blockComment` and `comments.lineComment` to control how VS Code should comment out lines / blocks.
  • >
  • > ```json
  • > {
  • > "comments": {
  • > "lineComment": "//",
  • > "blockComment": ["/*", "*/"]
  • > }
  • > }
  • > ```
  • Worst case, you may be able to modify the source of the package, but VSC may offer a way to modify package settings in your local config. (It has been a long time since I used it.)
  • [docs]: https://code.visualstudio.com/api/language-extensions/language-configuration-guide#comment-toggling
  • You can't edit it in settings, but I do know where those come from. It's in `language-configuration.json`, under `comments`:
  • > ## [Comment toggling][docs]
  • > VS Code offers two commands for comment toggling. **Toggle Line Comment** and **Toggle Block Comment**. You can specify `comments.blockComment` and `comments.lineComment` to control how VS Code should comment out lines / blocks.
  • >
  • > ```json
  • > {
  • > "comments": {
  • > "lineComment": "//",
  • > "blockComment": ["/*", "*/"]
  • > }
  • > }
  • > ```
  • Worst case, you may be able to modify the source of the package. VSC doesn't have options for tweaking those as part of its core. _However,_ since [other people][se] also have this need, Arturo Dent [made a package][dent] to maintain the package tweaks I suggested above.
  • > For example, if you prefer your line comments to look like `// *` you can set it to that in specific languages. Here is an example setting in user `settings.json`:
  • >
  • > ```json
  • > "custom-language-properties": {
  • > "javascript.comments.lineComment": "// *",
  • > "python.comments.lineComment": "# *",
  • > "python.brackets": [["{","}"],["[","]"],["(",")"]]
  • > }
  • > ```
  • >
  • > These are NOT additional comment styles, the default comment styles will be replaced by those in your setting. I suggest you do not go crazy with comment style for example, as other editors may not recognize them as comments. So something like `// **` is fine (the leading `//` will still be recognized as a comment) but `**` by itself will not be recognized by another editor or person without this extension and that setting.
  • [docs]: https://code.visualstudio.com/api/language-extensions/language-configuration-guide#comment-toggling
  • [se]: https://stackoverflow.com/q/69138666/241211
  • [dent]: https://github.com/ArturoDent/custom-language-properties
#2: Post edited by user avatar Michael‭ · 2024-09-11T20:01:00Z (3 months ago)
Fix path.
  • I don't know if you can edit it in settings, but I do know where those come from. It's in `language-config.json`, under `comments`:
  • > ## [Comment toggling][docs]
  • > VS Code offers two commands for comment toggling. **Toggle Line Comment** and **Toggle Block Comment**. You can specify `comments.blockComment` and `comments.lineComment` to control how VS Code should comment out lines / blocks.
  • >
  • > ```json
  • > {
  • > "comments": {
  • > "lineComment": "//",
  • > "blockComment": ["/*", "*/"]
  • > }
  • > }
  • > ```
  • [docs]: https://code.visualstudio.com/api/language-extensions/language-configuration-guide#comment-toggling
  • I don't know if you can edit it in settings, but I do know where those come from. It's in `language-configuration.json`, under `comments`:
  • > ## [Comment toggling][docs]
  • > VS Code offers two commands for comment toggling. **Toggle Line Comment** and **Toggle Block Comment**. You can specify `comments.blockComment` and `comments.lineComment` to control how VS Code should comment out lines / blocks.
  • >
  • > ```json
  • > {
  • > "comments": {
  • > "lineComment": "//",
  • > "blockComment": ["/*", "*/"]
  • > }
  • > }
  • > ```
  • Worst case, you may be able to modify the source of the package, but VSC may offer a way to modify package settings in your local config. (It has been a long time since I used it.)
  • [docs]: https://code.visualstudio.com/api/language-extensions/language-configuration-guide#comment-toggling
#1: Initial revision by user avatar Michael‭ · 2024-09-11T19:54:34Z (3 months ago)
I don't know if you can edit it in settings, but I do know where those come from. It's in `language-config.json`, under `comments`:

> ## [Comment toggling][docs]
> VS Code offers two commands for comment toggling. **Toggle Line Comment** and **Toggle Block Comment**. You can specify `comments.blockComment` and `comments.lineComment` to control how VS Code should comment out lines / blocks.
>
> ```json
> {
>   "comments": {
>     "lineComment": "//",
>     "blockComment": ["/*", "*/"]
>   }
> }
> ```


[docs]: https://code.visualstudio.com/api/language-extensions/language-configuration-guide#comment-toggling