(Windows, Linux Ctrl+.)) to see available refactorings. Visual Studio Code supports refactoring operations (refactorings) such as Extract Method and Extract Variable to improve your code base from within your editor.,For example, a common refactoring used to avoid duplicating code (a maintenance headache) is the Extract Method refactoring, where you select source code that you'd like to reuse elsewhere and pull it out into its own shared method.,This keybinding uses "preferred": true to create a refactoring that always tries to extract the selected source code to a constant in the local scope:,Select the source code you'd like to extract and then click on the lightbulb in the gutter or press (⌘. Source code refactoring can improve the quality and maintainability of your project by restructuring your code while not modifying the runtime behavior.
0 Comments
Leave a Reply. |