Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text 2 plugin won't show up in Command Platte

I started writing a Plugin for Sublime Text 2.

I created a new folder in "Packages/RailsQuick"

And Created 2 files:

RailsQuick.py

import sublime, sublime_plugin

class GeneratorsCommand(sublime_plugin.WindowCommand):
  def run(self):
    self.window.show_quick_panel(["test"], None)

RailsQuick.sublime-commands

[
  {
    "caption": "RailsQuick: Generators",
    "command": "rails_quick_generators"
  }
]

The problem is that i cant find RailsQuick: Generators in the Command Platte (CTRL + SHIFT + P)

Sublime Text 2 Command Platte

Console logs after saving both files:

Writing file /home/danpe/.config/sublime-text-2/Packages/RailsQuick/RailsQuick.py with encoding UTF-8
Reloading plugin /home/danpe/.config/sublime-text-2/Packages/RailsQuick/RailsQuick.py
Writing file /home/danpe/.config/sublime-text-2/Packages/RailsQuick/RailsQuick.sublime-commands with encoding UTF-8

What am i doing wrong ?

like image 391
Danpe Avatar asked Oct 06 '22 07:10

Danpe


1 Answers

My lucky guess:

Your class name is wrong. GeneratorsCommand should match the one defined in RailsQuick.sublime-commands (rails_quick_generators). Sublime Text 2 needs to have 1:1 mapping between these names, otherwise it cannot know which plug-in belongs to which shortcut.

Example:

https://github.com/witsch/SublimePythonTidy

like image 89
Mikko Ohtamaa Avatar answered Oct 10 '22 19:10

Mikko Ohtamaa