Keybindings won't show in settings


#1

Hello,

I recently installed navigator-godef and wanted to see its keybindings but did not find them in its settings page. Atom packages usually show ‘Keybindings’ section in Package -> Settings like for example in git-projects. I checked that keymaps/navigator-godef.json exists in the project. Any idea as to why the keybindings are not showing up in the settings?


#2

The one apparent difference between the two is that navigator-godef stores its keymap in JSON whereas git-projects stores its keymap in CSON.


#3

I did rewrite the json file into cson and reloaded Atom. I still couldn’t see it. Does Atom require us to write the package description file or does it read the keybindings on its own?


#4

Atom reads the keybindings on its own (at least the keybinding system does). I don’t know if the Settings View used the keybinding system to display that stuff or if it was reading the package metadata and then got tripped up on the JSON.

¯\_(ツ)_/¯

I’ll see if I can reproduce the problem later.


#5

Thank you for giving it a look. I look forward to a resolution to this.


#6

I figured it out. This code looks for keybindings that have the namespace set to the package name:

https://github.com/atom/settings-view/blob/master/lib/package-keymap-view.coffee#L55-L57

The namespace for the commands in the navigator-godef package is golang:

This is why they aren’t being displayed.


#7

I see. Is there a workaround for this?


#8

The commands could be rewritten to use the same namespace as the package. I’m not sure why they were done differently in the first place. This is probably something you should post to the package’s Issues list.


#9

What does redone mean? And yes, I will report the issue to the author soon.


#10

Sorry, updated to use “rewritten” instead of “redone” :grinning:


#11

Awesome! Thank you so much for you help. I sent in a PR with the changes.