- Total 39K
- Win 20K
- OS X 12K
- Linux 7K
|Dec 10||Dec 9||Dec 8||Dec 7||Dec 6||Dec 5||Dec 4||Dec 3||Dec 2||Dec 1||Nov 30||Nov 29||Nov 28||Nov 27||Nov 26||Nov 25||Nov 24||Nov 23||Nov 22||Nov 21||Nov 20||Nov 19||Nov 18||Nov 17||Nov 16||Nov 15||Nov 14||Nov 13||Nov 12||Nov 11||Nov 10||Nov 9||Nov 8||Nov 7||Nov 6||Nov 5||Nov 4||Nov 3||Nov 2||Nov 1||Oct 31||Oct 30||Oct 29||Oct 28||Oct 27||Oct 26|
- Goto definition of a variable or function
- Rename variable or function respecting its current scope
- Introduce variable
- Extract selected source to a new method
Clone or download the git repository into your packages folder. In Sublime Text use “Preferences/Browse Packages” menu item to open this folder. The shorter way of doing this is:
git clone https://github.com/s-a/sublime-text-refactor.git ~/.config/sublime-text-2/Packages/sublime-text-refactor
git clone https://github.com/s-a/sublime-text-refactor.git ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/sublime-text-refactor
In an elevated command prompt or powershell (as Admin):
git clone https://github.com/s-a/sublime-text-refactor.git "%APPDATA%\Sublime Text 2\Packages\sublime-text-refactor“
for Sublime Text 3:
git clone https://github.com/s-a/sublime-text-refactor.git "%APPDATA%\Sublime Text 3\Packages\sublime-text-refactor”
- This Plugin makes heavy usage of Node.js. So it needs a local installation of http://nodejs.org
- mocha (only for testing)
Select a keyword via double click or point the cursor to the keyword and choose “Goto Definition” from context menu.
Select a keyword via double click or point the cursor to the keyword and choose “Rename” from context menu. The plugin will select all variables or function calls occurring in the source code including its declaration. After that you rename them all on the fly. The logic respects the variables or functions scope. So it should be safe to rename them all without thinking ;) .
Select an Expression from source code or point the cursor to the desired position and choose “Introduce Variable” from context menu.
Select the source code you want to extract into a new method and choose “Refactor / Extract methode” from context menu. This will extract the source code instantly to a new methode aka function. The plugin will manage undeclared variable usages and pass them within a single bundled JSON parameter to the new function. It also generates a sample function call at the bottom of the new methode. The plugin marks all variables occurring in the source code so you can rename them on the fly.
Run the tests
Goto Pluginfolder and type npm test
You can find current test cases here
- Node not found
Preferences: Refactor Settings – Userfrom context menu and configure the
nodePathsetup. (Default Value is
"nodePath" : "node"
- Extract method
- Define exceptions of global scoped variable names like jQuery or $.
- Do not pass variables available in current Scope (optional).
- Let the user choose a function name before or after extraction.
- Let the user choose a custom position to insert extracted methode code and indent it correctly.
MIT and GPL license.
Copyright © 2013 Stephan Ahlf firstname.lastname@example.org
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.