You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement RFC 823 in template type checking, the language server and Vue syntax highlighting. Missing coverage is an error on the v-match subject and causes vue-tsc --noEmit to fail. Unreachable arms are warnings and do not change the CLI exit status.
The checker narrows each arm and subtracts the values covered by unguarded arms. It handles finite unions, nested object shapes, tuple combinations and array lengths. Optional property absence remains separate from present undefined; guards and union-typed runtime values do not prove coverage. Open or unresolved types require a catch-all. Bindings retain their narrowed types in guards, props, events and children.
Pattern helpers are ordinary TypeScript declarations under types/, referenced through the existing typesRoot mechanism only when a template uses v-match. They are checked with skipLibCheck: false. Generated templates contain pattern descriptors and helper references, without a copy of the type algorithm. Editor and CLI warnings reuse the active TypeScript Program.
Add hover, completion, definition, rename, directive completion, and TextMate scopes for patterns and guards.
This is a Draft reference implementation. The parser is mirrored until core #15531 is published. The CLI temporarily wraps Volar's program factory because it has no after-program hook; the wrapper is restored after runTsc. Companion documentation: docs #3465. This repository targets v3.4; the compiler PR targets minor.
Support v-match on the SFC top-level <template> with the same narrowing, coverage, and arm scopes. Header expressions retain their original locations for diagnostics, hover, completion, definition and rename. Header-only edits invalidate the template cache. Both default HTML and explicit lang="html" are tested. The top-level form in other template-language plugins remains unfinished.
At e68d41bfe, macOS, Windows and Linux CI pass. Locally, 360 tests pass with 4 existing skips; 150 companion-compiler tests pass.
Top-level SFC matches have the same narrowing, exhaustive coverage and lexical scopes as inner matches. Regressions cover default and explicit HTML, imported generics, mapped header diagnostics, hover/completion, definition/rename, and header-only edits. CLI tests still require missing coverage to fail and warnings alone to succeed. Other template-language plugins need follow-up integration for the top-level form.
Scope tests retain setup/prop/loop/slot shadowing, $event, duplicate declarations and navigation boundaries. Loop sources resolve before new loop bindings. The type algorithm remains an ordinary checked declaration in types/pattern-matching.d.ts, referenced through typesRoot; codegen/template/matchTypes.ts has been removed.
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement RFC 823 in template type checking, the language server and Vue syntax highlighting. Missing coverage is an error on the
v-matchsubject and causesvue-tsc --noEmitto fail. Unreachable arms are warnings and do not change the CLI exit status.The checker narrows each arm and subtracts the values covered by unguarded arms. It handles finite unions, nested object shapes, tuple combinations and array lengths. Optional property absence remains separate from present
undefined; guards and union-typed runtime values do not prove coverage. Open or unresolved types require a catch-all. Bindings retain their narrowed types in guards, props, events and children.Pattern helpers are ordinary TypeScript declarations under
types/, referenced through the existingtypesRootmechanism only when a template usesv-match. They are checked withskipLibCheck: false. Generated templates contain pattern descriptors and helper references, without a copy of the type algorithm. Editor and CLI warnings reuse the active TypeScript Program.Add hover, completion, definition, rename, directive completion, and TextMate scopes for patterns and guards.
This is a Draft reference implementation. The parser is mirrored until core #15531 is published. The CLI temporarily wraps Volar's program factory because it has no after-program hook; the wrapper is restored after
runTsc. Companion documentation: docs #3465. This repository targetsv3.4; the compiler PR targetsminor.Support
v-matchon the SFC top-level<template>with the same narrowing, coverage, and arm scopes. Header expressions retain their original locations for diagnostics, hover, completion, definition and rename. Header-only edits invalidate the template cache. Both default HTML and explicitlang="html"are tested. The top-level form in other template-language plugins remains unfinished.Validation:
pnpm test: 360 passing tests, 4 existing skips across 52 files.