Coder Social home page Coder Social logo

vscode-auto-fold's Introduction

lol ok github

vscode-auto-fold's People

Contributors

bobmagicii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vscode-auto-fold's Issues

[Feature Request] Add configuration to exclude files

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

Allow configuring multiple fold levels for a file extension

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] }
]

feature request / autofold in files of greater than a specified length

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.

fold recursively in reverse (pack source tree)

add option: bool autofold.pack

modify folding process:

  1. fold to level 2...
  2. unfold all (currently does)
  3. fold 9, 8, 7, 6, 5, 4, 3 (new feature)
  4. fold 2 (currently does)

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?

Autofold mess with search

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.

not folded completely in markdown with list points

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).

auto fold while just moving mouse with cmd pressed

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.

[bug] Randomly folds

Sometimes it randomly folds when I perform these actions:

  • paste (ctrl+v)
  • save (ctrl+s)
  • switch tabs

Environment:
ubuntu 19.04
vscode 1.33.1

feature request / autofold types of code per file type

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.

auto fold not working with python

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

[Feature Request] Only fold specific regions

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.

Existing functionality

Add //#region and //#endregion to create foldable sections of code. Click the arrow to the left to fold.

Prefered functionality

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...)

Feature Requesr: Fold regions only instead of levels

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.

[Feature Request]: Allow Auto-Fold of Block Comments

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!

Problem whith collapse

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.