Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(volar/define-slots): regular expression error #485

Merged
merged 2 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/healthy-ways-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vue-macros/volar": patch
---

fix(volar/define-slots): regular expression error
4 changes: 2 additions & 2 deletions packages/volar/src/define-slots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const transform = ({

replace(
embeddedFile.content,
/var __VLS_slots!: .*/,
/var __VLS_slots!: [\S\s]*?;/,
'var __VLS_slots!: __VLS_DefineSlots<',
(): Segment<FileRangeCapabilities> => [
// slots type
Expand All @@ -37,7 +37,7 @@ const transform = ({
typeArg!.pos,
FileRangeCapabilities.full,
],
'>'
'>;'
)
embeddedFile.content.push(
`type __VLS_DefineSlots<T> = { [SlotName in keyof T]: T[SlotName] extends Function ? T[SlotName] : (_: T[SlotName]) => any }`
Expand Down