463 questions
1
vote
1
answer
56
views
(::: {#thm-} ## title} problem folding math envs and outline
I have an issue with Quarto in VS Code whith folding and outlines.
Math envs have the syntax:
::: {#def-system}
This is a definition
:::
However, to give the enviroment a title you are suppose to use ...
0
votes
0
answers
63
views
How to get Visual Studio to fold/collapse my code similar to SourceLink
While looking at library code via SourceLink, I hit the shortcut key to collapse the code. The code collapsed as expected, and comment documentation blocks collapsed into an ellipsis on the same line ...
1
vote
1
answer
295
views
VS Code folding is out of sync for a large JSON file. How to fix?
When I edit large files (20k+ lines with a lot of objects) sometimes folding can break totally and fold not the lines that it should and not where it should be
I attached few screenshots here for ...
0
votes
0
answers
34
views
Eclipse PHP code folding functionality does not work
SETUP
Eclipse Version: 2024-06 (4.32.0)
PHP Development Tools (PDT) 8.2.0.202311292129
PROBLEM
Code folding option is only available for HTML, but not for PHP
When pressing CTRL + /, the code moves ...
0
votes
0
answers
71
views
EOF prevents folding entire functions in Shellscript
I'm having a small problem with folding and unfolding things in VSCode shellscript code. When I write a function and add a help section to it, with a heredoc that ends in EOF, naturally - After this, ...
0
votes
0
answers
249
views
Does Swift have an equivalent to C#'s `#region`?
I'm looking for an equivalent way to create labeled code folding regions in Swift.
In C# you can do this with the #region directive, which is a no-op that just creates a code folding section that you ...
0
votes
1
answer
670
views
In VS Code + Python, is there a way to fold only functions (and not if/else statements)? [duplicate]
I'm new to Python, and I'm trying to fold my code in a way that's similar to regular Visual Studio with C#.
In VS, you can press Ctrl+M, Ctrl+O to fold all methods and #regions, and then press Ctrl+M, ...
4
votes
2
answers
6k
views
Treesitter and syntax folding
not sure if this is well known, but I spent a few hours searching documentation, stack overflow and reddit and never found a clear explanation. So I am posting this here, in case some one else faces ...
1
vote
1
answer
224
views
Why don't the match/case code blocks collapse in PyCharm?
In the case of if-elif-else constructs, classes, class methods, loops, etc., there is an option to collapse a code block using the arrows on the left. However, this functionality is missing for the ...
1
vote
0
answers
279
views
How to remove folding in R code in R studio
Very basic question but one that I am struggling with and thus can use some guidance...
I am working in Rstudio and modifying an existing script. It is full of foldable regions and they are really ...
0
votes
2
answers
102
views
Declaring foldl ( from left) in terms of foldr (from right)
I have foldl:
let rec foldl f lst acc = match lst with
| [] -> acc
| hd::tl -> foldl f lst (f hd acc)
and I have foldr:
let rec foldr f lst acc = match lst with
| [] -> acc
| hd::tl ...
-1
votes
1
answer
120
views
Getting the two minimum values from a list in OCaml
I need to write a function twoMin: int list → int * int using foldl that returns the two smallest values (not elements) of a list. You may assume that the list contains at least two elements with ...
-1
votes
1
answer
43
views
Using foldl to get the mean of a list
I am trying to get the mean of a list by using the following helping function:
let rec foldl f l b = match l with
| [] -> b
| x :: l -> foldl f l (f x b);;
let avg l = foldl (fun x acc ->...
2
votes
0
answers
105
views
In Vim, how do I have the default behavior when opening a Python file be open all folds
I have this in my .vimrc
autocmd FileType python setlocal foldmethod=indent
so that I can use zr zR zm zM to see different levels of my Python files. The only thing is when I open a Python script, it'...
0
votes
1
answer
172
views
How can I fold/collapse regional Java code in Eclipse?
Java editor folding preferences only have the following:
Comments,
Header Comments,
Inner Types,
Members,
Imports
However, I want to fold some arbitrary part of my code.
I tried enable folding of ...
0
votes
0
answers
93
views
Manual folding in vim
When manual folding is active, I fold lines 21-23 in the following code,
19 while (fgets(line, LINESIZE, fp)) {
20 line[strlen(line)-1] = '\0';
21 if (regexec(&...
1
vote
1
answer
284
views
How can I move lines or folded regions before or after other folded regions?
Assume we have a folded region, let's say of 50 rows. Let's call it "TheRegion".
After TheRegion we've got a line. Let's call it "TheLine".
Now I want to move TheLine before ...
1
vote
0
answers
76
views
Xcode, Fold group of codes under certain method/ function with a simple click
I Have a multiple if else statements under another if else statements and I want to be able to fold all child statements under certain parent without have to fold each one separately cause its like ...
1
vote
1
answer
700
views
How to enable code folding in ASP.NET Core Razor syntax in VS Code?
I am trying to edit Razor pages (.cshtml) in VS Code for a .NET Core project. When I open the file it chooses the ASP.NET Razor (aspnetcorerazor) language mode. It does syntax highlighting perfectly, ...
0
votes
0
answers
121
views
How to make a hierarchical structure of folds/collapses in the text editor?
I want to format this:
# 1 =====
tibble()
## 1.1 ====
tibble()
### 1.1.1 ====
tibble()
# 2 =====
tibble()
## 2.1 ====
tibble()
### 2.1.1 ====
tibble()
If I collapse # 1 and # 2, I would like to get:
#...
3
votes
1
answer
851
views
Code Folding with custom Lexer (ScintillaNET)
The problem is Scintilla control does the folding automatically, which means the folding doesn't work if you do your own lexer.
I'm using this to configure the control if you want to take a look at ...
1
vote
0
answers
321
views
Java, Code Folding using Coffee Bytes for Eclipse 2022 and higher versions
When I was using Eclipse 2018-12 (Java 8) I could use Coffee-Bytes plugin for Code Folding.
Coffee-Bytes plugin is rally awesome, but recently I have found that I can use Eclipse 2022 based on JDK 11 (...
1
vote
1
answer
217
views
Why can't I see the Code Folding menu item in PyCharm Edu edition? (2022.2)
In other editors, I use code folding to collapse all of the functions in a file, but can't seem to get this option to show in PyCharm Education edition (2022.2). It should show under the "Code&...
0
votes
2
answers
136
views
Fold Results in VSCode Search Editor (*not* search explorer)
I'm looking for a way to fold all results in a VSCode search editor. (It's clear how to do this in the search explorer.)
I can easily fold individual results with cmd+opt+[ but I want to fold all of ...
-1
votes
2
answers
444
views
To speed up data refresh should I create a view or use query folding?
I have an SQLite database of 5GB which gets updated few times a day and is used to refresh a PowerBI dashboard. While below 1GB I could refresh the dashboard in under a minute, but now takes around 20 ...
1
vote
0
answers
55
views
Is it possible using a vscode extension to get info on which regions are folded in the editor?
I would like to find a way to get the folded regions in the active editor using a custom extension.
I have done a lot of researches, but I didn't find anything on this subject.
Also, I tried to query ...
0
votes
0
answers
906
views
Visual Studio 2022 C/C++ Can not collapse if/else/while statements but can collapse functions
I'm not sure why this is not working. I've installed a fresh version of windows and freshly installed visual studio. I can no longer collapse if/else/while statements but I can collapse functions.
I'...
1
vote
0
answers
442
views
VS Code custom folding provider works once then breaks upon file edit
UPDATE:
The breaking of the custom code folding extension appears to be due to it conflicting with the VSCode C# extension. If the C# extension is disabled the custom folding works as expected, but ...
2
votes
1
answer
931
views
Prevent VS Code from folding comments
I searched several hours already, but I couldn't find a way to prevent VS Code from putting the little folding icon in the gutter for my // style comments in my javascript and typescript files.
How ...
0
votes
1
answer
249
views
VSCode - Cannot Fold Comment Block
Ok - we've all all hit the wall with something pitifully stupid. Today was my turn.
I couldn't fold (collapse) a comment block in VSCode. Searched StackOverflow and others for a solution and came up ...
6
votes
3
answers
5k
views
Is it possible to divide your code into sections for R in vscode?
Is there a way to use code sections similar to RStudio's # --- or MATLAB's %% in VSCode? I would like to divide my code to sections and selectively run those sections. Is that possible?
Thanks,
Yasir
3
votes
2
answers
4k
views
Mark specific code block to fold/collapse by default in PyCharm
I want to mark some particular functions to fold by default.
Something like:
# PyFoldDefault
def my_func() # PyFoldDefault - will hide a function.
...
Similar behavior there in PyCharm, for ...
1
vote
1
answer
722
views
I can't find widget to fold or expand children widget
I am sorry about cant upload IMG because of sign up first. so I got the link
https://getbootstrap.com/docs/3.3/javascript/#collapse
like this function,
I want to make a widget in normal times, only ...
2
votes
0
answers
50
views
VSCode C++ Folding with Member Initializer Lists
Currently Using VS Code with C++.
I have this code here:
Test::Test()
: varA{0}, varB{1}
{
}
that I want to collapse into the code like so:
Test::Test()
But it only lets me collapse the code if ...
1
vote
1
answer
677
views
VS Code Recreate Folding behaviour of Plain Text
For a custom language, I what the same folding behavior of "Plain Text", meaning leaving out blank lines:
I expected Plain Text folding behavior as default, but as soon as I switch to my ...
0
votes
1
answer
146
views
Global code folding in bookdown with default set to "hide global"
The very first answer of this wonderful post shows a straight forward javascript that will to insert a toggle to hide all code in a bookdown doc.
Although I have tried many different variations and ...
3
votes
2
answers
144
views
Folding with anonymous functions
I'm currently trying to learn folding.
But instead of using predefined functions I want to use my own.
So I want to double all vowels in a String.
doubleVowels :: String -> String
My attempt is (...
0
votes
2
answers
1k
views
Finish code folding in one line (and keep folding sign visible all the time)
Code folding in VScode doesn't seem as good as IntelliJ's.
eg. code block
def g(a):
print(a)
print(a)
print(a)
print(a)
print(a)
Or, for (...),{...},[...] (indentation isn't ...
1
vote
1
answer
1k
views
set fillchars=foldclose:▸ in .vimrc does not work to change '+--' folding characters
I'm using vim 8.2.
In my .vimrc file I was able to change fold with fillchars successfully:
set foldmethod=indent
set fillchars=fold:\
But it does not work when I tried with foldopen and foldclose ...
2
votes
1
answer
2k
views
Outline for text file?
In visual-studio-code I can have a text file with folding based on tabs.
I find this a light way to keep notes.
Any ideas if there's a way to show those fold levels in the outline window.
This would ...
0
votes
1
answer
79
views
How can I set the same key to toggle the folding of the current block in Visual Studio?
I need to set on one single key (F1 specifically) both the collapse and the expand of the current block, in VS Pro 2019.
I thought I did it in the past, but I seem not to find it again anymore.
Simply ...
5
votes
3
answers
5k
views
Copy & Paste folded Code in Visual Studio Code
When I copy folded code it just pastes the beginning line (that's visible).
For example if I copy this code when it's folded:
Expanded(
flex: 2,
child: Image(
image: AssetImage('images/...
0
votes
1
answer
107
views
How to fold away all variables to improve code readabillity?
In some my code i have a lot of variables. So to make it more readable i want to be able to fold them away so instead of this:
public class BIhcsAhuStartSeq_v2 {
int counterVal_1 =0;
int ...
1
vote
0
answers
138
views
How do I keep VSCode from folding past the same indentation level
In the gif I've attached you can see that if I fold on line 136 it keeps the blank line and you still see the next aligned section. If I fold at line 146, it swallows the next section even though they ...
1
vote
1
answer
3k
views
Python Folding in Neovim
For some reason folding really won't work in neovim for me. I've tried a few different folding plugins and they all just say 'E490: No fold found' when I try to fold a code block.
Am I using it ...
1
vote
1
answer
790
views
PhpStorm - can you "collapse to level" without recursion?
One feature that I miss from Visual Studio (and which I've never seen anywhere else) is "collapse methods" or something like that. In essence, you collapse method (function) bodies and ONLY ...
2
votes
0
answers
121
views
Folding removes syntax highlighting when editing *.twig files in Eclipse
When editing *.twig files in mac osx Eclipse both syntax highlighting and folding are working fine on their own. Am I doing something wrong or is it a bug/feature? When both are enabled, the syntax ...
0
votes
1
answer
256
views
How to disable all code folding in Pycharm/Intellij Diff and Merge
We can see the folding in this Diff/Merge screen by the + signs:
That used to not happen and I want to permanently disable the folding. How can I do that? JetBrains docs https://www.jetbrains.com/...
2
votes
1
answer
3k
views
Can't make code folding in dart (flutter) with vs code for specific blocks
I'm trying to make a code folding for the "for loop" and for "if statement " in flutter with vs code but i can't .however the code folding works well if i try to fold the hole ...
0
votes
1
answer
448
views
PyCharm + IdeaVim : how to disable auto-unfolding on caret touch?
When editing folded Python code with IdeaVim, if the caret/cursor touches a folded zone represented by ... (or region_name if using a #region tag), the folded section immediately unfolds.
I'd like to ...