jamalsenouci / sublimetext-syntaxfold

Sublime Text Plugin that provides a configurable command and popup for folding code based on syntax
MIT License
40 stars 6 forks source link

Source Scoped Fold Markers #19

Closed skeid21 closed 7 years ago

skeid21 commented 7 years ago

Jamal,

There are some substantial changes to the structure of the plugin. I work in Sublime across Objc, Objc++, c++, c#, Java and Python daily. I wanted the ability for your plugin to select the start and end markers by the source files syntax.

I'll be happy to work with you on any adjustments that need to be made. I'd love for these changes to make it into master, so that I can share with my team as we are going to start utilizing regions for organization in our code base.

Also, please forgive my lack of experience in python.(I'm essentially a c++ programmer stumbling through python). If I've done something in an uncommon approach, please inform me and I'll be happy to adjust it.

Also, I didn't update the documentation yet. I'll wait until I get feedback from you, and squash the commits.

Kind Regards, Shawn

    * Add facilities to allow start and end markers to be selected based on the current files source type
    * Update FoldCurrent command to have same visual presentation as FoldAll by adjusting end position of generated region
    * Extract region selection to helper functions
    * Extract iteration over fold regions to methods taking lambdas
jamalsenouci commented 7 years ago

Hi Shawn,

This looks like a good improvement over the current implementation. A couple of things would be firstly that the plugin would not support files that don't have a syntax definition but that shouldn't be a massive problem, if you're going to be folding code, you'll probably want syntax highlighting first. Secondly I think changes to the sublime-settings file will break the plugin for existing users. I would just make a note in the documentation/changelog to manually update the settings file to support the changes.

If you could run it through a python linter as well like flake8 and add in the documentation changes then that would be great and I'll be happy to merge the changes. Thanks for taking the time to work on this, I'm glad it's getting some use.

skeid21 commented 7 years ago

Jamal,

What version would you like me to use for the next version?

On Sun, Jan 1, 2017 at 1:14 PM, Jamal Senouci notifications@github.com wrote:

Hi Shawn,

This looks like a good improvement over the current implementation. A couple of things would be firstly that the plugin would not support files that don't have a syntax definition but that shouldn't be a massive problem, if you're going to be folding code, you'll probably want syntax highlighting first. Secondly I think changes to the sublime-settings file will break the plugin for existing users. I would just make a note in the documentation/changelog to manually update the settings file to support the changes.

If you could run it through a python linter as well like flake8 and add in the documentation changes then that would be great and I'll be happy to merge the changes. Thanks for taking the time to work on this, I'm glad it's getting some use.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jamalsenouci/sublimetext-syntaxfold/pull/19#issuecomment-269917657, or mute the thread https://github.com/notifications/unsubscribe-auth/AFYw10STCr06xVHzyyjuOcM0sjfPVrCnks5rOAkrgaJpZM4LX3SF .

jamalsenouci commented 7 years ago

2.0

skeid21 commented 7 years ago

Jamal,

Let me know if those changes look good. I ran flak8 and pylint and made appropriate changes. Once it all looks good, let me know and I'll squash the two commits.