Skip to content

Commit

Permalink
在 JSX 标签上链接光标
Browse files Browse the repository at this point in the history
5.1
  • Loading branch information
zhongsp committed Jul 2, 2023
1 parent 7108d18 commit f19f4e1
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions zh/release-notes/typescript-5.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@ function Foo(props: FooProps) {
```tsx
// In some library's code or in an augmentation of that library:
namespace JSX {
interface IntrinsicElements {
["a:b"]: { prop: string };
}
interface IntrinsicElements {
['a:b']: { prop: string };
}
}

// In our code:
Expand All @@ -292,3 +292,23 @@ let x = <a:b prop="hello!" />;

更多详情请参考 [PR](https://github.com/microsoft/TypeScript/pull/51715)

## 在 JSX 标签上链接光标

TypeScript 现在支持 _链接编辑_ JSX 标签名。
链接编辑(有时称作“光标镜像”)允许编辑器同时自动编辑多个位置。

这个新特性在 TypeScript 和 JavaScript 里都可用,并且可以在 Visual Studio Code Insiders 版本中启用。
在 Visual Studio Code 里,你既可以用设置界面的 `Editor: Linked Editing` 配置:

![](https://devblogs.microsoft.com/typescript/wp-content/uploads/sites/11/2023/04/linkedEditing-5.1-vscode-ui-1.png)

也可以用 JSON 配置文件中的 `editor.linkedEditing`

```json
{
// ...
"editor.linkedEditing": true
}
```

这个功能也将在 Visual Studio 17.7 Preview 1 中得到支持。

0 comments on commit f19f4e1

Please sign in to comment.