Skip to main content

Crate vize_canon

Crate vize_canon 

Source
Expand description

§vize_canon

Canon - The standard of correctness for Vize. TypeScript type checker for Vue.js Single File Components.

§Name Origin

Canon (/ˈkænən/) in art refers to a set of ideal proportions or standards that define perfection. Just as classical sculptors followed canons to achieve harmonious proportions, vize_canon enforces type correctness as the standard for Vue SFC code.

§Architecture

§Batch Type Checking (via corsa-bind)

┌─────────────────────────────────────────────────────────────────┐
│                         vize Process                            │
│                                                                 │
│  Project                    Virtual Project                     │
│  ┌──────────────┐          ┌──────────────────────────┐        │
│  │ src/         │          │ node_modules/.vize/canon │        │
│  │ ├─ App.vue   │ ──────▶  │ ├─ src/                  │        │
│  │ ├─ utils.ts  │          │ │  ├─ App.vue.ts         │        │
│  │ └─ ...       │          │ │  ├─ utils.ts           │        │
│  └──────────────┘          │ │  └─ ...                │        │
│                            │ └─ tsconfig.json         │        │
│                            └──────────────────────────┘        │
│                                       │                         │
│                                       ▼                         │
│                            ┌──────────────────────────┐        │
│                            │  Corsa ProjectSession    │        │
│                            │  sync msgpack stdio      │        │
│                            └──────────┬───────────────┘        │
│                                       │                         │
│                                       ▼                         │
│                            ┌──────────────────────────┐        │
│                            │ Diagnostics + SourceMap  │        │
│                            │ → Map to original SFC    │        │
│                            └──────────────────────────┘        │
└─────────────────────────────────────────────────────────────────┘

Re-exports§

pub use lsp_client as corsa_client;
pub use intelligence::Completion;
pub use intelligence::CompletionKind as IntelCompletionKind;
pub use intelligence::CursorContext;
pub use intelligence::Diagnostic;
pub use intelligence::DiagnosticSeverity;
pub use intelligence::HoverInfo;
pub use intelligence::Location;
pub use intelligence::TypeIntelligence;
pub use sfc_typecheck::SfcRelatedLocation;
pub use sfc_typecheck::SfcTypeCheckOptions;
pub use sfc_typecheck::SfcTypeCheckResult;
pub use sfc_typecheck::SfcTypeDiagnostic;
pub use sfc_typecheck::SfcTypeSeverity;
pub use sfc_typecheck::type_check_sfc;
pub use sfc_typecheck::type_check_sfc_with_legacy_vue2;
pub use sfc_typecheck::type_check_sfc_with_options_api;
pub use source_map::Mapping;
pub use source_map::MappingFlags;
pub use source_map::MappingKind;
pub use source_map::Position;
pub use source_map::SourceMap;
pub use source_map::Span;
pub use source_map::offset_to_position;
pub use source_map::position_to_offset;
pub use corsa_bridge::CorsaBridge;
pub use corsa_bridge::CorsaBridgeConfig;
pub use corsa_bridge::CorsaBridgeError;
pub use corsa_bridge::LspCompletionItem;
pub use corsa_bridge::LspCompletionList;
pub use corsa_bridge::LspCompletionResponse;
pub use corsa_bridge::LspDefinitionResponse;
pub use corsa_bridge::LspDiagnostic;
pub use corsa_bridge::LspDocumentation;
pub use corsa_bridge::LspHover;
pub use corsa_bridge::LspHoverContents;
pub use corsa_bridge::LspLocation;
pub use corsa_bridge::LspMarkedString;
pub use corsa_bridge::LspMarkupContent;
pub use corsa_bridge::LspPosition;
pub use corsa_bridge::LspRange;
pub use corsa_bridge::VIRTUAL_URI_SCHEME;
pub use batch::BatchTypeChecker;
pub use batch::BatchTypeCheckerOptions;
pub use batch::CorsaError;
pub use batch::CorsaExecutor;
pub use batch::CorsaNotFoundError;
pub use batch::DeclarationEmitOptions;
pub use batch::DeclarationEmitResult;
pub use batch::DeclarationOutput;
pub use batch::Diagnostic as BatchDiagnostic;
pub use batch::ImportRewriter;
pub use batch::ImportSourceMap;
pub use batch::PackageManager;
pub use batch::SfcBlockType;
pub use batch::TypeCheckResult as BatchTypeCheckResult;
pub use batch::TypeChecker as BatchTypeCheckerTrait;
pub use batch::VirtualFile;
pub use batch::VirtualProject;
pub use batch::VirtualTsGenerator;
pub use batch::sfc_block_fallback_offset;
pub use typecheck_service::SfcDiagnostic;
pub use typecheck_service::SfcDiagnosticSeverity;
pub use typecheck_service::SfcRelatedInfo;
pub use typecheck_service::SfcTypeCheckResult as CorsaTypeCheckResult;
pub use typecheck_service::TypeCheckService;
pub use typecheck_service::TypeCheckServiceOptions;
pub use corsa_server::CheckParams;
pub use corsa_server::CheckResult as CorsaServerCheckResult;
pub use corsa_server::CorsaServer;
pub use corsa_server::Diagnostic as CorsaServerDiagnostic;
pub use corsa_server::JsonRpcError;
pub use corsa_server::JsonRpcRequest;
pub use corsa_server::JsonRpcResponse;
pub use corsa_server::ServerConfig;

Modules§

batch
Batch TypeScript type checking for Vue SFC.
corsa_bridge
Corsa bridge for the native TypeScript checker.
corsa_server
Corsa server for Vue SFC type checking.
corsa_session_cache
Cache key for Corsa project sessions.
intelligence
Type intelligence for Vue SFCs.
lsp_client
Corsa project-session client backed by an adaptive stdio transport.
sfc_typecheck
SFC type checking functionality for Vue Single File Components.
source_map
High-performance bidirectional source map for SFC ↔ Virtual TypeScript mapping.
typecheck_service
Type check service using Corsa.
virtual_ts
Virtual TypeScript generation for Vue SFC type checking.

Structs§

Binding
A binding available in the template.
CheckResult
Check result from the type checker.
CompletionItem
Completion item from type analysis.
Import
Import information.
Prop
A prop definition.
TypeChecker
Type checker for Vue SFC templates.
TypeContext
Type context for a Vue SFC.
TypeDiagnostic
A type diagnostic from the type checker.
TypeInfo
Type information for a value or expression.

Enums§

BindingKind
Kind of binding.
CompletionKind
Kind of completion item.
Locale
Supported locales
TypeErrorCode
Type error codes.
TypeKind
Kind of type for categorization.
TypeSeverity
Severity of a type diagnostic.