srusskih / SublimeJEDI

awesome Python autocompletion with SublimeText
MIT License
938 stars 109 forks source link

Rename all occurrences of symbol, and automatically highlight all occurrences of symbol #297

Closed kylebebak closed 5 years ago

kylebebak commented 5 years ago

This PR adds two new functionalities.

The first is the ability to rename all occurrences of a symbol in a project.

It piggybacks on the sublime_jedi_find_usages command by adding a first option that allows users to rename the symbol in all files in the project.

Screen Shot 2019-07-13 at 2 46 04 PM

If the user chooses this first option, they are prompted to change the name of the symbol using Window.show_input_panel.

Screen Shot 2019-07-13 at 2 46 31 PM

Also visible the first screenshot is the new functionality to optionally highlight all occurrences of a symbol. Occurrences of logger are underlined whenever the selection changes (by using an EventListener and View.add_regions). Calls to ask_daemon to get usages are debounced by 350ms.

By default, this behavior is disabled. It can be enabled with the highlight_usages_on_select setting. Users can change the underline color with the highlight_usages_color settings, which must be an empty string, or one of ("region.redish", "region.orangish", "region.yellowish", "region.greenish", "region.bluish", "region.purplish", "region.pinkish", "region.blackish").


Finally, this PR adds the Default.sublime-commands file, so that the sublime_jedi_goto, sublime_jedi_find_usages, sublime_jedi_docstring, sublime_jedi_signature commands are discoverable from the command palette.

srusskih commented 5 years ago

@kylebebak Thank, will look on it asap.

kylebebak commented 5 years ago

@srusskih

Thanks for the review, there were a lot of good changes here. I think it's all ready to go now.

srusskih commented 5 years ago

@kylebebak You did impressive job!

kylebebak commented 5 years ago

Thanks for merging this! And thanks for continuing to maintain this awesome plugin!

srusskih commented 5 years ago

🚀