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

Code folding cells #7846

Closed
fgiaret opened this issue Sep 6, 2018 · 8 comments · Fixed by spyder-ide/pyls-spyder#15
Closed

Code folding cells #7846

fgiaret opened this issue Sep 6, 2018 · 8 comments · Fixed by spyder-ide/pyls-spyder#15

Comments

@fgiaret
Copy link

fgiaret commented Sep 6, 2018

Hi, I hope this is the right place to ask this kind of questions. I'm currently using Spyder 4.0.0b1 and I find the code folding feature very useful: is it possible to define regions in code, in a way similar to C#?

#region
//some methods
#endregion

If it doesn't already exist, I think that such a feature would be very useful to organise bigger projects.
Thanks!

@ccordoba12
Copy link
Member

ccordoba12 commented Sep 6, 2018

is it possible to define regions in code, in a way similar to C#?

Yes, you can. In our case (this works in Spyder and also in PyCharm) is

#%%
code
#%%

However, they can't be folded. Is that what you need?

@fgiaret
Copy link
Author

fgiaret commented Sep 7, 2018

Yes, if sections defined by #%%...#%% were foldable/unfoldable, that would be exactly what I meant.

@ccordoba12
Copy link
Member

Ok, that's a very good suggestion! We'll try to implement it for beta3.

@fgiaret
Copy link
Author

fgiaret commented Sep 7, 2018

Great, thank you very much!

@bcolsen
Copy link
Member

bcolsen commented Sep 8, 2018

I like this 👍

I think it would be really great if they respected the code cell levels like the outline explorer with #%%% as a sub cell that would get folded when the top level folds.

@ccordoba12 ccordoba12 modified the milestones: v4.0beta3, v4.0beta4 May 18, 2019
@ccordoba12 ccordoba12 changed the title Code folding custom regions Code folding cells Jul 29, 2019
@ccordoba12 ccordoba12 modified the milestones: v4.0betaX, v4.0beta5 Jul 29, 2019
@ccordoba12 ccordoba12 mentioned this issue Jul 29, 2019
10 tasks
@ccordoba12 ccordoba12 modified the milestones: v4.0beta5, future Aug 10, 2019
@MadsMohr
Copy link

MadsMohr commented Feb 3, 2020

Also looking for this feature! would be very nice.

@goanpeca goanpeca removed this from the future milestone Feb 23, 2020
@jamesdgessel
Copy link

Also hoping for this feature!!! Would be amazing.

@ccordoba12
Copy link
Member

I think this is going to be solved in 4.2, thanks to the work @andfoy is doing in PR #13109.

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

Successfully merging a pull request may close this issue.

7 participants