-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Conversation
Glad to see it ready!! 😃 |
This is pretty awesome 👍 The PreferencesManager.definePreference("some.preferenceHere", "boolean", true, Strings.some.preferenceHere.description); edit: Actually, going with the edit 2: CodeFolding already does this but it's not visibile to UI so the variables are just in the brackets/src/extensions/default/CodeFolding/Prefs.js Lines 12 to 41 in 9dfbebe
|
}); | ||
it("should detect an array", function () { | ||
// After [ | ||
ctxInfo = JSONUtils.getContextInfo(testEditor, {line: 24, ch: 23}); |
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.
refactoring candidate with a for loop.
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.
Cancel that, i see that this is just a test file 👍
+1 |
@abose Wanted to get some input on this so I marked it review only. @petetnt Going to add i18n support today. Some preferences have got their own UI, so we don't want to have each and every pref in the code hints. I was thinking about providing an API to extension devs, so they can plug in their hints. Something like As far as the core brackets preferences, we should use data.json, so translators (who are encouraged to commit on the web) can easily translate descriptions in a single file. @rroshan1 Glad you liked it. :) |
Added internationalization support, moved all the descriptions to |
I'm not too set about adding all these strings to the core nls file, as it's quite a lot of new strings. |
@marcelgerber We can also move it to its own |
I think it would be ok; if not easier to manage in the core file itself. adding js translation files for separate features would eventually decrease the maintainability of translations[as i saw in several other large projects]. For instance you would have to search over several files to find a string const; but with just one file, they are generally easy to locate; also people would need to go through several files to see if some strings changed to figure out translations. |
@abose Is there anything else remaining to cover in this PR? |
Nice 👍 |
* @return {Object} | ||
*/ | ||
getAllPreferences: function () { | ||
return $.extend(true, {}, this._knownPrefs); |
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.
Instead of $.extend
for cloning you can use _.clone
and _.cloneDeep
from lowdash which is already included in the core.
@abose Can you give this PR a review. |
@sprintr will do some test with the changes and update by tomorrow 👍 |
@@ -0,0 +1,573 @@ | |||
/* |
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.
Could this file be moved to the /test/
folder?
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.
This is a standard practice that most of the core extensions do.
@sprintr Thanks for putting up this PR 👍 Really appreciate it! I had a small suggestion. I think right now one has to manually go about editing the json file to make sure the preference name, along with its values kind of popup in code hints, while editing the preference file. How about adding another parameter to This way extension writers can make sure their extension's preference names and values popup in the code hint. Also we need to clearly document what needs to be done, going forward, to create a new preference in Brackets core. I was thinking if we can automate the job, but I might sound crazy 😼 |
@nethip I wrote a tiny extension to demonstrate how extension authors can plugin their hints. Just modified |
@sprintr |
@abose I am going to do two things tomorrow.
|
@sprintr Right now the scroll-bar fix truncates long code hints. Instead of truncating, if we change the css for |
@sprintr LanguageManager actually defines its preferences, so you can modify the code there instead of including them in brackets/src/language/LanguageManager.js Lines 1147 to 1152 in 5d4269c
With #11197, pretty much all preferences (except the meta |
@marcelgerber You can now check marquee and exclusion of code hints. for exclusion add @abose We now have a marquee animation to show code hints longer than the box. |
Very nice! I also love the marquee effect |
preference; | ||
Object.keys(preferences).forEach(function (pref) { | ||
preference = preferences[pref]; | ||
if (preference.excluded) { |
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.
Maybe something more distinct, like excludeFromHints
?
@marcelgerber Removed the width of hint object and it seems we don't need marquee anymore. Can you check it. |
@sprintr some width jumps are there with just |
@abose Yeah, it works that way. It only happens where no description is available. |
Verified. All unit tests passing. Merging. |
@sprintr Thanks for this awesome contribution 🎉 |
@abose Awesome! |
@sprintr, great! this is really helpful! |
Issue #11200 tracks the doc changes required and hints for the new preferences API |
🆒 |
This PR implements code hints for the preferences we use in brackets. Additionally it also shows a little description of the active preference to the user.
CC:
@redmunds @ryanstewart @MiguelCastillo