1、提取变量

2、提取方法

上面都是通过选中文本后出现的小灯泡操作的:

vscode 学习笔记 —— 重构

3、全局替换(多个文件中的)某个变量

选中变量按 F2,输入完成后按回车

二、vscode 插件


js-refactorhttps://github.com/cmstead/js-refactor

体验不好,放弃

三、总结


vscode 的重构功能还是没有 webstorm 好用且全面。比如:即使装了 js-refactor 插件也没有 safe delete 的功能。


参考资料

https://code.visualstudio.com/docs/editor/refactoring

相关文章:

  • 2023-01-26
  • 2021-09-06
  • 2022-12-23
  • 2021-05-03
  • 2021-12-19
  • 2021-06-09
  • 2022-02-11
猜你喜欢
  • 2022-12-23
  • 2021-07-03
  • 2021-10-07
  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案