stef-levesque / vscode-autohotkey

AutoHotkey language support for VS Code
MIT License
96 stars 23 forks source link

Folding multiline comment #22

Open ghost opened 5 years ago

ghost commented 5 years ago

How to adding function to fold comment like this in .ahk / comment 1 comment 2 ... /

thomastthai commented 4 years ago

I have this on my system. Would you look at the pictures and let me know if that's what you meant?

image image

thomastthai commented 4 years ago

I noticed my comments have the star preceding the in-between lines like ' * additional lines in between'. I'm going to look into this.

thomastthai commented 4 years ago

Hi @fekfoq259! I got both cases working. I'm still learning Github and will look into how to do a pull request and submit it.

image

image

AucaCoyan commented 3 years ago

I've just tried in my code, but apparently it doesn't have comment folding. Maybe it's an added functionality from other extension? (I don't have colored comments). I put my cursor right between of the /* and the 62 line but nothing appears, nor the shortcut Ctrl+Shift+ ' works. image

Hicsy commented 3 years ago

I've just tried in my code, but apparently it doesn't have comment folding. Maybe it's an added functionality from other extension? (I don't have colored comments). I put my cursor right between of the /* and the 62 line but nothing appears, nor the shortcut Ctrl+Shift+ ' works.

Gday mate, VSCode automatically supports codefolding for anything indented. With multiliner's you can indent your comments to fold as expected.

PS. If you look at styleguides from the likes of Google or Amazon, you will see their multiline comments often look like:

/*
 * My Function
 * TODO: Write Function
 */

They will line up nicely then, and also automation will pick them up better as a bonus 😇

Hicsy commented 3 years ago

BTW This repo looks a bit quiet, but I have proposed a PR for supporting ;region ... ;endregion comments on the forked version of this plugin, if that helps!

You can edit ahk.configuration.json to include this:

    "folding": {
      "markers": {
          "start": "^\\s*\\;\\s*region\\b",
          "end": "^\\s*\\;\\s*endregion\\b"
      }
    }

cheers!