Make ts-morph available for *.vue files
npm install vue-ts-morphProvides Vue single file component (*.vue) support for ts-morph
``bash`
npm install vue-ts-morph
yarn add vue-ts-morph
pnpm install vue-ts-morph
`ts
import { createVueFileSystemHost } from 'vue-ts-morph';
import { Project } from 'ts-morph';
const project = new Project({
fileSystem: createVueFileSystemHost(),
});
project.addSourceFilesFromTsConfig('tsconfig.json');
`
Both ts-morph and Volar implements their own LanguageServiceHost. That fact makes it hard to use them together.
To put it very simply, Volar adds virtual file for each SFC. Vue's older language support Vetur also does it.
While we are not able to pass a custom LanguageServiceHost, we can still implement FileSystemHost interface of ts-morph.
This library implements virtual .vue.ts file that translates read/write for source .vue file.
Currently does not support section and simultaneous