This package integrates TypeScript Twoslash query capabilities directly into Volar-powered language services, enhancing developer tooling within Vue and other Volar-supported environments. It allows for inline type information and error checking queries within code comments, similar to how TypeScript's own playground functions. As of version 0.0.70, it is still in a pre-1.0 stage, indicating potential API changes but is actively maintained as part of the Volar ecosystem. Its release cadence is typically tied to Volar's own development cycle, meaning updates often coincide with new Volar releases or when new Twoslash features need integration. Key differentiators include its seamless integration into Volar's Language Server Protocol, providing rich type feedback without needing external tools or complex build steps for ad-hoc type queries directly within your editor.
npm install volar-service-typescript-twoslash-queriesVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to integrate the Twoslash queries service into a Volar configuration file.
Pin exact package versions (e.g., '0.0.70') in your `package.json` and review release notes thoroughly for any updates before upgrading.
Ensure the installed version of `volar-service-typescript-twoslash-queries` matches the recommended version for your `@volar/language-service` installation. Check the package's `peerDependencies` and Volar's documentation.
Run `npm install volar-service-typescript-twoslash-queries` or `yarn add volar-service-typescript-twoslash-queries` in your project.
For CommonJS, use `require('volar-service-typescript-twoslash-queries').create()`. For ESM, use `import { create } from 'volar-service-typescript-twoslash-queries';` and then call `create()`.Update `volar-service-typescript-twoslash-queries` to a version that specifically supports your `@volar/language-service` version. Consult the package's `peerDependencies` in `package.json`.