-
Notifications
You must be signed in to change notification settings - Fork 7.6k
integration of code-folding extension into brackets #10792
Conversation
Out of curiosity, any reason to not keep this as an extension? |
@Florian-R There has been demand to have code folding in the default user experience for brackets. It made sense to reuse an already popular extension to provide this support in core |
@thehogfather Thanks 👍 |
@prksingh I had hoped that Brackets has kept some sort of Node philosophy, "small core, vibrant userland" but anyway thanks for your input. |
@abose sure thing. |
@Florian-R in general, that's our philosophy, but code folding has been on our list as "core" for a very long time. Most major editors have it out of the box. It's also far and away one of the most popular extensions, so it was clear that users were missing it. |
A couple of things we want to do as part of the merge:
Open question here: Do we allow separate code folding preferences per project? or just globally? or per file? |
alwaysUseIndentFold: true, | ||
enableRegionFolding: true, | ||
fadeFoldButtons: false, | ||
maxFoldLevel: 2 // this value is only used when fold all is called |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: indentation
@thehogfather It is awesome that you are brining this into brackets!! High-5. I did not realize how big your extension was! But I did a quick pass and it seems that one glaring inconsistency is the mix of spaces/tabs and that lots of the function are defined right in the Really happy this is coming in. |
@MiguelCastillo No problem. I'll work on these fixes and update. :) |
You should probably merge your translations (at least the English ones) into our main |
* commit 'e56192e09ceed72834985f2483ed70e339e5c519': Logos are now perfectly centered Whitespace trimming suggested by @marcelgerber Fix some moved APIs that were left over from PR adobe#10641 Text is now perfectly centered
I've tidied up and refactored a bit based on the suggestions (thanks all). I've moved preferences to brackets.json and merged the english strings into brackets main strings. There is also an option to disable the extension in the settings dialog (should this be on the menu instead - or as well?). I have translations for fi, fr, ja, nl, pt-br and ru but haven't merged yet. Shall I go ahead and merge those? |
@thehogfather Please go ahead and merge all the translations for this, barring fr and ja. The fr and ja will need to go through our translation process. |
@thehogfather As i understand, the translations, the HTML dialogs and the menu entries are for the settings dialog for code folding. But as @ryanstewart pointed out in an earlier comment, Brackets doesn't set app preferences with dialogs; But customizable options are set in the preerences file and the default options are set in the 'brackets.json' file in the repo. As the code folding extension is directly integrated with brackets, i think it would be best if it confirms to brackets preferences settings.
|
* commit 'fd6c8acca823e3cf197e6d3ac0ab9adea190843e': (31 commits) Added a newline Adding newline Updating the comments Updating the comments Removing this preference as it should be set to true by default. Changing function name. Decreasing timeout to 4 sec. Adding unit test cases. Submitting changes suggested in PR review. Setting ONE_DAY to correct value. Initially value used for testing was left by mistake. Removing serverTestURL as it is not needed now. Moving lastTimeSentData before making AJAX call to make sure data is not sent before ONE_DAY as setting it to always() will be asynchronous Move the implementation to the extensions. Data will be send to the server as soon as user has launched the Brackets and dialog box prompting for user to opt-in and opt-out is closed. Rework the comments and defects. Test cases has not been added yet. Will be adding to the next PR. Updated by ALF automation. Updated by ALF automation. Extended {APP_NAME} Correcting jshint errors. Deleting duplicate string. Synchronized with latest root commit "developer" -> "pengembang" Fixed text wrapping Add comments.. ... Conflicts: src/nls/root/strings.js
@MiguelCastillo just pushed an update for all those fixes + merged with the latest commit from master. |
Merge pull request #10792 Code Folding by Patrick Oladimeji; Github:@thehogfather
@thehogfather Thanks for the help. Merged into master. |
@thehogfather yeah man, your last changes look very good. Thank you, this is a great addition to brackets! Now you gotta come up with another really cool extension :) @abose I really like the idea of adding the package.json for attribution :) |
Congrats on the merge, @thehogfather! 😄 |
👍 thanks all. Glad I could help. @abose I guess I would mainly check that folded states are persisted and restored correctly, and that the preference options (enabled, minFoldSize etc.) work as intended. |
@@ -0,0 +1,268 @@ | |||
/** | |||
* Based on http://codemirror.net/addon/fold/foldcode.js | |||
* @author Patrick Oladimeji |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still need to keep the original copyright from CodeMirror here
@thehogfather I was verifying the unit tests and some of the integration tests in the unit test setup is failing. |
Code folding is enabled in all files by default, and in some files like txt files it looks a bit odd. |
@abose wrt unit tests, I am unable to run them completely. They freeze with about 125 tests to go. Can you tell me the file throwing the error or show a stack trace? I remember spotting one a while back in one of the imported codeMirror range finders. |
There is a memory issue with the unit tests currently, so we won't be able to run all tests in a single go. But Issue#10857 seems to be much more important than this. My understanding of the extension is limited; it might take a while for me to fix it. Could you take a look at the issue? |
@abose I took a quick look at those unit tests and it seems like the Health Report notification dialog might be causing problems in some of them (you can see it popping up in each test run, even though there's code that should suppress it). The 3 QuickOpen failures might be different -- I can repro them on my old smart-autocompelte branch (which doesn't have code folding or Health Report), so those failures might be caused by my recent PR there. I can try to take a look tomorrow -- lmk if you find anything out before then. |
The health notifications dialogs will be disabled when unit tests are nunning, but i guess that PR is still under review. |
There's a wiki page with Tips and Tricks for Running Brackets Unit Tests so just add any new tips there and share this link. |
Why there is no option to disable this feature? It's ugly. |
Thanks @le717 ! |
@le717 Oh I didn't noticed. thanks |
Integration of core code-folding extension files into brackets' default extension folder.