提交 c09ef1a7 编写于 作者: M Matt Bierner

Remove refactor/extract from interactive playground

Fixes #51575

Don't highlight a feature in the interactive playground that does not work properly
上级 4f5ef279
......@@ -5,7 +5,6 @@ The core editor in VS Code is packed with features. This page highlights a numb
* [IntelliSense](#intellisense) - get code assistance and parameter suggestions for your code and external modules.
* [Line Actions](#line-actions) - quickly move lines around to re-order your code.
* [Rename Refactoring](#rename-refactoring) - quickly rename symbols across your code base.
* [Refactoring via Extraction](#refactoring-via-extraction) - quickly extract common code into a separate function or constant.
* [Formatting](#formatting) - keep your code looking great with inbuilt document & selection formatting.
* [Code Folding](#code-folding) - focus on the most relevant parts of your code by folding other areas.
* [Errors and Warnings](#errors-and-warnings) - see errors and warning as you type.
......@@ -90,21 +89,6 @@ function Book(title, author) {
> **JSDoc Tip:** VS Code's IntelliSense uses JSDoc comments to provide richer suggestions. The types and documentation from JSDoc comments show up when you hover over a reference to `Book` or in IntelliSense when you create a new instance of `Book`.
### Refactoring via Extraction
Sometimes you want to refactor already written code into a separate function or constant to reuse it later. Select the lines you want to refactor out and press kb(editor.action.quickFix) or click the little light bulb and choose one of the respective `Extract to...` options. Try it by selecting the code inside the `if`-clause on line 3 or any other common code you want to refactor out.
```js
function findFirstEvenNumber(arr) {
for (const el of arr) {
if (typeof el === 'number' && el % 2 === 0) {
return el;
}
}
return null;
}
```
### Formatting
Keeping your code looking great is hard without a good formatter. Luckily it's easy to format content, either for the entire document with kb(editor.action.formatDocument) or for the current selection with kb(editor.action.formatSelection). Both of these options are also available through the right-click context menu.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册