-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle errors spanning multiple tokens
- Loading branch information
1 parent
fbdf0a2
commit e501f8c
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
"shiki-twoslash": minor | ||
--- | ||
|
||
Added support for highlighting errors that span multiple tokens. | ||
|
||
Previously, error highlighting checked each token in a line to see if an error should be applied. This failed to apply an error highlight when the error spanned multiple tokens, like `T`+`[`+`Key`+`]` in the following example: | ||
|
||
```ts | ||
type MyPick<T, K> = { | ||
[Key in K]: T[Key]; | ||
}; | ||
``` | ||
|
||
`T[Key]` will now be correctly highlighted as an error. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters