RESOLVED FIXED 189589
Add Copy WebKit Permalink plugin for Sublime Text
https://bugs.webkit.org/show_bug.cgi?id=189589
Summary Add Copy WebKit Permalink plugin for Sublime Text
Daniel Bates
Reported 2018-09-13 10:08:00 PDT
I frequently switch between Xcode and Sublime Text 3. We should port the Copy WebKit Permalink Automator service to a Sublime Text plugin so that the same functionality can be accessed in Sublime Text. Porting to a Sublime Text plugin would also make this convenience service available to a larger audience because Sublime Text is cross-platform (available on Mac, Linux, and Windows at the time of writing).
Attachments
Patch (42.81 KB, patch)
2018-09-13 10:39 PDT, Daniel Bates
joepeck: review+
Daniel Bates
Comment 1 2018-09-13 10:39:14 PDT
Created attachment 349679 [details] Patch I tested this plugin in Sublime Text 3 on Mac version 3.1.1 (build 3176). If someone wants to test aon Window or Linxu that would be great. It should work in Sublime Text 2 given that I used <https://code.tutsplus.com/tutorials/how-to-create-a-sublime-text-2-plugin--net-22685> as a reference when writing the plugin. For now, there are only key bindings for Mac because that is the platform I use and is the platform I am most familiar with the keyboard shortcut conventions for. Do any Windows or Linux developers have suggestions for good (read: do not conflict with other apps) key bindings sequences? We need two sequences: one for generating a permalink without blame annotations and one for generating a permalink with blame annotations.
EWS Watchlist
Comment 2 2018-09-13 10:40:32 PDT
Attachment 349679 [details] did not pass style-queue: ERROR: Tools/CopyPermalink/Sublime Text/CopyWebKitPermalink/CopyWebKitPermalink.py:35: [CopyWebKitPermalinkCommand.run] Instance of 'CopyWebKitPermalinkCommand' has no 'view' member [pylint/E1101] [5] ERROR: Tools/CopyPermalink/Sublime Text/CopyWebKitPermalink/CopyWebKitPermalink.py:43: [CopyWebKitPermalinkCommand.run] Instance of 'CopyWebKitPermalinkCommand' has no 'view' member [pylint/E1101] [5] ERROR: Tools/CopyPermalink/Sublime Text/CopyWebKitPermalink/CopyWebKitPermalink.py:43: [CopyWebKitPermalinkCommand.run] Instance of 'CopyWebKitPermalinkCommand' has no 'view' member [pylint/E1101] [5] ERROR: Tools/CopyPermalink/Sublime Text/CopyWebKitPermalink/CopyWebKitPermalink.py:51: [CopyWebKitPermalinkCommand.is_enabled] Instance of 'CopyWebKitPermalinkCommand' has no 'view' member [pylint/E1101] [5] ERROR: Tools/CopyPermalink/Sublime Text/CopyWebKitPermalink/CopyWebKitPermalink.py:51: [CopyWebKitPermalinkCommand.is_enabled] Instance of 'CopyWebKitPermalinkCommand' has no 'view' member [pylint/E1101] [5] Total errors found: 5 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
Daniel Bates
Comment 3 2018-09-13 10:44:02 PDT
(In reply to Build Bot from comment #2) > Attachment 349679 [details] did not pass style-queue: > > > ERROR: Tools/CopyPermalink/Sublime > Text/CopyWebKitPermalink/CopyWebKitPermalink.py:35: > [CopyWebKitPermalinkCommand.run] Instance of 'CopyWebKitPermalinkCommand' > has no 'view' member [pylint/E1101] [5] > ERROR: Tools/CopyPermalink/Sublime > Text/CopyWebKitPermalink/CopyWebKitPermalink.py:43: > [CopyWebKitPermalinkCommand.run] Instance of 'CopyWebKitPermalinkCommand' > has no 'view' member [pylint/E1101] [5] > ERROR: Tools/CopyPermalink/Sublime > Text/CopyWebKitPermalink/CopyWebKitPermalink.py:43: > [CopyWebKitPermalinkCommand.run] Instance of 'CopyWebKitPermalinkCommand' > has no 'view' member [pylint/E1101] [5] > ERROR: Tools/CopyPermalink/Sublime > Text/CopyWebKitPermalink/CopyWebKitPermalink.py:51: > [CopyWebKitPermalinkCommand.is_enabled] Instance of > 'CopyWebKitPermalinkCommand' has no 'view' member [pylint/E1101] [5] > ERROR: Tools/CopyPermalink/Sublime > Text/CopyWebKitPermalink/CopyWebKitPermalink.py:51: > [CopyWebKitPermalinkCommand.is_enabled] Instance of > 'CopyWebKitPermalinkCommand' has no 'view' member [pylint/E1101] [5] > Total errors found: 5 in 8 files > > > If any of these errors are false positives, please file a bug against > check-webkit-style. These warnings can be ignored as Pylint does not have access to the Sublime modules to check dependencies related to inheritance from class sublime_plugin.TextCommand.
Joseph Pecoraro
Comment 4 2018-09-13 10:52:53 PDT
Comment on attachment 349679 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=349679&action=review Neat! rs=me > Tools/CopyPermalink/Sublime Text/CopyWebKitPermalink/Context.sublime-menu:2 > + { "command": "copy_web_kit_permalink" }, Why "web_kit" and not "webkit"? > Tools/CopyPermalink/Sublime Text/CopyWebKitPermalink/Default (OSX).sublime-keymap:2 > + { "keys": ["super+ctrl+shift+c"], "command": "copy_web_kit_permalink" }, Ditto.
Joseph Pecoraro
Comment 5 2018-09-13 10:54:09 PDT
Comment on attachment 349679 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=349679&action=review >> Tools/CopyPermalink/Sublime Text/CopyWebKitPermalink/Context.sublime-menu:2 >> + { "command": "copy_web_kit_permalink" }, > > Why "web_kit" and not "webkit"? Maybe this was needed to convert to the python class name: CopyWebKitPermalinkCommand
Daniel Bates
Comment 6 2018-09-13 11:03:57 PDT
(In reply to Joseph Pecoraro from comment #5) > Comment on attachment 349679 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=349679&action=review > > >> Tools/CopyPermalink/Sublime Text/CopyWebKitPermalink/Context.sublime-menu:2 > >> + { "command": "copy_web_kit_permalink" }, > > > > Why "web_kit" and not "webkit"? > > Maybe this was needed to convert to the python class name: > CopyWebKitPermalinkCommand Correct.
Daniel Bates
Comment 7 2018-09-13 11:07:32 PDT
Radar WebKit Bug Importer
Comment 8 2018-09-13 11:08:25 PDT
Note You need to log in before you can comment on or make changes to this bug.