lol ok github
bobmagicii / vscode-auto-fold Goto Github PK
View Code? Open in Web Editor NEWA Visual Studio Code extension to automatically fold code if a magic comment is found.
A Visual Studio Code extension to automatically fold code if a magic comment is found.
lol ok github
Be able to exclude files by directory.
Use case is being able to auto-folding all PHP code, except in the views (templates) directory (saves me from pressing ctrl+k, ctrl+j for every template file).
Expect the configuration setting to be an array of paths / globs to be excluded
I want my *.tsx files to be folded at level 1 and 2, but I haven't found a way to do so. It would be nice to be able to do something like this:
"autofold.types": [
{ "ext": ".tsx", "level": 1 },
{ "ext": ".tsx", "level": 2 }
]
or
"autofold.types": [
{ "ext": ".tsx", "level": [1, 2] }
]
This is a feature request.
I would love to see a configuration such that files less than a specified length are not folded. It all fits on the screen and if I opened it it would be ok to assume I want to read it all. I would recommend a default of either 25 or 50. Most of my files fall somewhere in there.
I would love to collaborate on this if needed.
vscode-fold=#
tag inside a file does nothing
add option: bool autofold.pack
modify folding process:
this will cause subtrees to always be closed. currently, step 3 does not happen, so unfolding to level 2 will go from nothing seen to all the things seen. i would like it to be optional to always attempt to keep the view minimalistic.
the only question is how async is vscode. if i loop 9-3 as fast as i can, is there a chance code will async them out of order because nodejs
should the default be false to emulate current behaviour, or should it be true to be what i want myself out of the box because its my extension?
When using search, if the item is in a folded area, sometimes vs code won't unfold it, instead it just highlight the dots in the end of the line. Not sure if that's because of this plugin but I didn't experience it in the original vscode interface.
Set folding level to 1
. With a markdown file like this:
# heading a
* list item 1
something
# heading b
* list item 2
something in this list
place the cursor is at heading b
, then reload window, then the file opens with heading a
folded, but heading b
with list item 2
showing, but not the something in this list
(the list itself is folded).
like the extension. however for me it is not usable because it trigger auto fold while just moving the mouse when cmd is pressed (what i do often to click on symbols). I failed so far to nail it down in a way that is reproducible. its very strange but it seems to happen only when moving the mouse quite fast.
Sometimes it randomly folds when I perform these actions:
Environment:
ubuntu 19.04
vscode 1.33.1
vscode-auto-fold does not working for herodoc strings.
This is a feature request.
I would love to see configurations for types of code. For example I've read the extremely verbose types and interfaces in typescript a million times and most people put them at the tops of the file. This is very annoying. I want to have the valuable code unfolded, but types, enums, and interfaces should be folded.
If needed I would love to collaborate on this.
by default or setting to, do not auto-fold files which's folding states was loaded from memory .
i have this magic comment in my python file
# vscode-fold=2
when i open the file it ignores this comment and uses the default but when i manually run the auto fold command it then acknowledge that the comment exists and follows the comment's settings
VS Code has the nice feature of being able to create custom regions for folding. I use this a lot in my React JS files, where I create many contexts and define long hooks at the top of the file. Thing is: I rarely have to deal with these elements, so I want them to be folded. The regions are already there, but with many files, still comes a lot of clicking.
Add //#region
and //#endregion
to create foldable sections of code. Click the arrow to the left to fold.
Add //#region autofold
and //#endregion
to create foldable sections of code that automatically fold when the file is opened. Either leave the rest of the file alone, or still do the other things this extension does, like folding to a specific level based on a comment or file extension.
This would make granular control possible, something that I'd love to see. Hopefully it's not too hard to implement.
(Also, who made Shift+Return submit...)
Firstly, ,THANK YOU GREAT WORK!
My apologies if answered but I'm a little confused. Ive set Autofold :1but it does not FOLD ALL(Win k Win 0) , which is what i'd prefer.
Can i do this?
It would be nice to have a setting to fold only specified regions in a file. Given that recent changes made in VSCode (https://code.visualstudio.com/updates/v1_17#_folding-regions) now allow specifying custom regions on a per-language basis, it would be great to see this integrated into auto-fold.
The general idea is instead setting the preferred level of folding, one can set a bool flag of foldRegions
instead which would only fold regions in a file.
Hey Guys.
This is more of a question. How do you prevent comments from folding?
Looks like this extension is potentially going through some rewrite based on recent commits :)
In addition, I think it would be a useful feature to include ability to set automatic folding of all block comments as well.
(in my opinion, this is particularly useful where my .js files have lots of JSDoc block comments)
For just my personal usage, I was messing around with this very briefly, the following modification/command seems to work fine in practice:
if (Level === 999) { // TODO: replace with better Config value check
vscode.commands.executeCommand('editor.foldAllBlockComments');
}
else {
vscode.commands.executeCommand('editor.foldLevel' + Level);
}
I just removed the 0-9 level validation to get something quick and dirty working, I think ideally the final implementation could allow to specify Level config as maybe 'foldAllBlockComments' or 'comments' or '/' - something like that would be preferred for clarity and non "magic number"
Thanks!
Hi @bobmagicii,
thanks for your neat and useful plugin.
Just want to add a small improvement: using glob syntax in the autofold.types
ext
field. E.g.:
"autofold.types": [
{ "ext": ".y*ml", "level": 5}
]
Hello friends.
I use Visual studio code as PHP IDE (among other languages). I'm currently using autofold with great pleasure, but there is a catch.
I want only the methods to collapse and not the conditions within them.
With the methods it works very well at level 3:
{"ext": ".php", "level": 3}
But it also minimizes conditions (if, else, etc.) and loops (for, foreach, etc.)
public function test_function () // <-- Collapse perfect!
{
If (condition = 1) // <-- I don't want it to collapse
{
echo 'Hello World!';
}
}
Thanks!
JM
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.