zokugun / vscode-explicit-folding

Customize your Folding for Visual Studio Code
MIT License
99 stars 14 forks source link

first time user confused, sorry! #28

Closed op12no2 closed 3 years ago

op12no2 commented 3 years ago

Hi,

We have a huge code repo folded with !{{{ and }}} for various file extensions . For the last 20 years we have used a custom written editor. In trying to enter the 21st century we are trying vsCode. I installed your extension, which seems exactly what we require but cannot get it to work.

my settings code looks like this:-

{
   "folding": {
      "*": {
        "begin": "!{{{",
        "end": "!}}}"
      }
   }
}

But when I open a file folded like that, it does not show folded. This is vsCode newly installed today. I'm probably doing something silly and pointers would be appreciated. Thanks.

daiyam commented 3 years ago

@op12no2 The closing marker is }}} or !}}} ? Anyway, I've just tested with both and it's working. Which language are the files ? Do you have an example ?

op12no2 commented 3 years ago

Hi,

Closing marker is !}}}

File contain Clarion code. File extension is .clw. ! is the comment character.

op12no2 commented 3 years ago

Example - but would have a .clw extension. Github did not allow upload of .clw.

as_stuff.txt

daiyam commented 3 years ago

So you are using the emacs foldings which is my main purpose for writing this extension...

My config:

{
  "editor.foldingStrategy": "auto",
  "folding": {
    "*": {
      "begin": "{{{",
      "end": "}}}"
    }
  }
}

Here what I got: Screen Shot 2020-12-11 at 4 15 26 PM

op12no2 commented 3 years ago

Capture Capture2

OK thanks. I must be doing something wrong, or missing something obvious :) I'll keep fiddling. Should not make a difference but this is a Windows 10 context.

daiyam commented 3 years ago

Ya, something isn't right. I had it working but then it doesn't... I will have to debug to understand why.

Screen Shot 2020-12-11 at 4 47 01 PM

In the meantimes, you could try with MrCode

daiyam commented 3 years ago

@op12no2 I've found the issue... here the working config:

{
    "editor.showFoldingControls": "always",
    "folding": {
        "*": {
            "begin": "{{{",
            "end": "}}}"
        },
    },
}
op12no2 commented 3 years ago

That's very helpful thanks. It's recognising the folds now but starting with them all open. Do you know a way to start with them all closed on file open? Sorry to be a pain!

daiyam commented 3 years ago

Glad that's working. No I don't but I use the shortcut editor.foldAll (when: editorTextFocus).

op12no2 commented 3 years ago

Thanks. crtl+k+0 by default does it. I'll figure out how to do that on file open. Thanks very much for your help. If you are ever in Swansea I'll buy you endless drinks :)