Nathan Sobo
8cb8f09803
Return a Disposable instance from DeserializerManager::add
2014-09-30 12:58:10 -06:00
Nathan Sobo
4a0c5aaa70
Prevent adjacent menu separators
2014-09-30 12:06:27 -06:00
Nathan Sobo
eb929cb7a2
Honor item specificity while still preserving addition order
...
Rather than using order to specify item precedence, we now construct
a set of menu items for each element traversing upward from the target.
When merging items for a given element, we pass the specificity to the
merge function, which uses it to decide whether or not to clobber
existing items. When assembling the overall menu, we don’t ever clobber
to ensure that items added for elements closer to the target always win
over items matching further up the tree.
2014-09-30 12:06:27 -06:00
Nathan Sobo
36d5359ef4
Restore original context menu ordering
...
Previously I used CSS specificity to order the most specific / recently
added menu items for a given element *first* when building up the
context menu. When a duplicate label was found for a given menu I would
refrain from inserting it. Now instead I order things the opposite way.
The most specific / recently added items come later and items with the
same label are clobbered by later items.
2014-09-30 12:06:26 -06:00
Nathan Sobo
915cfe15f5
Clear context menus between specs
2014-09-30 12:06:26 -06:00
Nathan Sobo
f082f93ead
Update specs for new ContextMenuManager API/behavior
...
When selectors have the same specificity, menu items added *later*
appear higher in the list.
2014-09-30 12:06:26 -06:00
Nathan Sobo
782f9c609e
Add shouldDisplay hook for context menu items
...
If present, if a falsy value is returned from this function for a given
context menu invocation, the item will not be displayed.
2014-09-30 12:06:09 -06:00
Nathan Sobo
3a567b3c5b
Call context menu item ::created hooks with the click event
2014-09-30 12:06:08 -06:00
Nathan Sobo
c5b395579b
Add devMode flag to individual items
2014-09-30 12:06:08 -06:00
Nathan Sobo
f8225a6441
Make arguments atom.contextMenu.add consistent with atom.menu.add
2014-09-30 12:06:08 -06:00
Nathan Sobo
5e6e3c8d72
Merge pull request #3655 from atom/ns-menu-disposables
...
Return disposables from MenuManager::add and add specs
2014-09-30 12:05:11 -06:00
Ben Ogle
a8d93f9cf4
Spec for unsubscribing from commands
2014-09-30 09:45:55 -07:00
Ben Ogle
b54deccfae
String type must be strict.
...
It makes sense to coerce from more general -> more specific data types.
eg. string -> int, etc. But coercing the other way is problematic
in the case of chaining because the more general type will swallow the
specific type. eg. Setting `false` on type: [‘string’, ‘boolean’] will
coerce the boolean to a string, and will never allow the value to be
a boolean.
2014-09-29 16:09:49 -07:00
Ben Ogle
a7185a894f
Fix specs
2014-09-29 16:09:49 -07:00
Ben Ogle
16c7fd3d70
Add spec for update event on load
2014-09-29 16:09:49 -07:00
Ben Ogle
08b138997d
Change the onDidChange / observe arguments
...
Support passing no keypath
2014-09-29 16:09:48 -07:00
Ben Ogle
ef19e925e9
Strings accept numbers too
2014-09-29 16:09:48 -07:00
Ben Ogle
2c1fa19e27
Update spec strings
2014-09-29 16:09:48 -07:00
Ben Ogle
22fb5adda9
Remove deprecated calls for config.observe .. callNow: false in core
2014-09-29 16:09:47 -07:00
Ben Ogle
800dee09ba
Make boolean schema validator a little tighter
2014-09-29 16:09:47 -07:00
Ben Ogle
6b4ce902ba
Undefined in Config::set always unsets the value
2014-09-29 16:09:46 -07:00
Ben Ogle
03a9a67ba8
Move spec
2014-09-29 16:08:04 -07:00
Ben Ogle
ae76bd6c96
Do not allow infinity in number types
2014-09-29 16:08:04 -07:00
Ben Ogle
662fc443dc
Fix specs
2014-09-29 16:08:04 -07:00
Ben Ogle
0fc773c1fc
Warn when loading bogus values from the user's config
2014-09-29 16:08:03 -07:00
Ben Ogle
832b4ae4d8
Fix specs
2014-09-29 16:08:03 -07:00
Ben Ogle
af1bdaf901
Dont fail when there are thigns to set with array and object types
2014-09-29 16:08:03 -07:00
Ben Ogle
969ca048e8
Fix specs
2014-09-29 16:08:03 -07:00
Ben Ogle
0d2fdec326
Fix specs in config
2014-09-29 16:08:03 -07:00
Ben Ogle
fc3ba775c8
Support schemas in packages
2014-09-29 16:08:03 -07:00
Ben Ogle
0bb8821644
Editor config uses a schema
2014-09-29 16:08:03 -07:00
Ben Ogle
5fdf3f894c
Load the config from Atom class so as not to duplicate
2014-09-29 16:07:02 -07:00
Ben Ogle
5bf09716ef
convert the workspace config to use a schema
2014-09-29 16:06:27 -07:00
Ben Ogle
9fff544955
Fix specs
2014-09-29 16:05:24 -07:00
Ben Ogle
9fbbd1e59b
Back to getSchema
2014-09-29 16:05:24 -07:00
Ben Ogle
2c1190b552
Validate enum keywords
2014-09-29 16:05:24 -07:00
Ben Ogle
5e9a269278
getSchema -> schemaForKeyPath
2014-09-29 16:05:24 -07:00
Ben Ogle
f7f28e7995
Handle minimum and maximum keywords on number types
2014-09-29 16:05:24 -07:00
Ben Ogle
ac67430926
Handle bad values in number type
2014-09-29 16:05:23 -07:00
Ben Ogle
409b5536e1
Support arrays
2014-09-29 16:05:23 -07:00
Ben Ogle
2526ba0efb
Add an object filter
2014-09-29 16:05:23 -07:00
Ben Ogle
1a8c5ba551
Handle validation of schema types
2014-09-29 16:05:23 -07:00
Ben Ogle
f909d32826
Support more types
2014-09-29 16:05:23 -07:00
Ben Ogle
d0bb49dea0
Add type filter system to config
2014-09-29 16:05:23 -07:00
Ben Ogle
02e87555f4
Handle schema loading
2014-09-29 16:05:23 -07:00
Ben Ogle
a79c015774
Update ::observe and add ::onDidChange
2014-09-29 16:05:23 -07:00
Nathan Sobo
f6f891fa14
Construct test instance of MenuManager in spec
2014-09-29 11:45:01 -06:00
Nathan Sobo
be7d093a4a
Merge remote-tracking branch 'origin/master' into ns-workspace-custom-elements
...
Conflicts:
package.json
2014-09-29 11:13:45 -06:00
Nathan Sobo
2f93032a37
Don’t add duplicate items to the same menu
2014-09-29 11:11:36 -06:00
Nathan Sobo
c058b44a1b
💄 spec description
2014-09-29 11:11:10 -06:00