Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] minimal folding options #1143

Open
andykais opened this issue Sep 5, 2018 · 1 comment
Open

[FR] minimal folding options #1143

andykais opened this issue Sep 5, 2018 · 1 comment

Comments

@andykais
Copy link

andykais commented Sep 5, 2018

I would love to see the ability to fold a single level like methods on classes, or top-level functions only.
It looks like suggestions like this have been rejected before (#888). However, I wonder if options like these would be less agressive to fold. The use case is working with very large react files that have a single class with many methods on them. A small example would be this:

import * as React from "react";

class App extends React.Component {
  state = {
    isShowing: true
  };

  handleOnClick = () => {
    // fold this function
  };

  render() {
    // fold this function
    const { props, state } = this;

    return (
      <div>
        <button onClick={this.handleOnClick}>
          {state.isShowing ? "hide" : "show"}
        </button>

        {state.isShowing && (
          <div>
            {props.list.map(image => (
              <img src={image.src} alt="" />
            ))}
          </div>
        )}
      </div>
    );
  }
}

export default App;

are the main constraints on not adding fine grained control to folding the cpu load?

@zdm
Copy link

zdm commented Nov 3, 2018

Guys, could you, please, review my PR #1136 .
It solves problem completely and makes folds fully configurable.
If PR is acceptable I can update it to match the latest code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants