1

VScode provided some ways to fold regions:

For a log file having 330560 lines of text, the Fold selection is not a good option, since it is not easy to select thousand of lines. I am able to use things like #region/#endregion and convert the log file to C# or python source code file by using ctrl+shift+p -> Change Language Mode but I am wondering if any better/less hacking way to fold lines in a text file. e.g using regexp? or add some special marker to let the editor knows a block text is a foldable region?

Spoiler Alert: Due to https://github.com/microsoft/vscode/issues/90843 makes the VSCode a bad choice for log viewing. It is no good for using VSCode to check logs.

r0n9
  • 2,505
  • 1
  • 29
  • 43
  • 1
    [This extension](https://github.com/zokugun/vscode-explicit-folding) can do custom folding rules based on regex. – HolyBlackCat Mar 13 '23 at 23:51
  • Can you select your regions by some regex? – Mark Mar 14 '23 at 02:29
  • @Mark I am not sure how to use regex to select a region – r0n9 Mar 15 '23 at 01:52
  • There are a number of ways to use a regex to select some code. Put your regex into a Find Widget and then `Alt+Enter` for example or `Ctrl+Shift+L`. I was just asking if you are able to craft a regex that would capture what you want to fold. – Mark Mar 15 '23 at 02:30
  • See https://stackoverflow.com/questions/75190983/is-there-a-way-to-fold-all-groups-of-lines-that-start-with-a-certain-word-for-a/75191133#75191133 and https://stackoverflow.com/questions/75664233/hide-style-props-in-vscode-extention/75680188#75680188 – Mark Mar 15 '23 at 03:28

0 Answers0