11import { createLanguageServiceHost , resolveFileLanguageId , type TypeScriptProjectHost } from '@volar/typescript' ;
2- import * as vue from '@vue/language-core' ;
2+ import * as core from '@vue/language-core' ;
33import { posix as path } from 'path-browserify' ;
44import type * as ts from 'typescript' ;
55
@@ -28,15 +28,15 @@ export function createCheckerByJsonConfigBase(
2828 return baseCreate (
2929 ts ,
3030 ( ) => {
31- const commandLine = vue . createParsedCommandLineByJson ( ts , ts . sys , rootDir , json ) ;
31+ const commandLine = core . createParsedCommandLineByJson ( ts , ts . sys , rootDir , json ) ;
3232 const { fileNames } = ts . parseJsonConfigFileContent (
3333 json ,
3434 ts . sys ,
3535 rootDir ,
3636 { } ,
3737 undefined ,
3838 undefined ,
39- vue . getAllExtensions ( commandLine . vueOptions )
39+ core . getAllExtensions ( commandLine . vueOptions )
4040 . map ( extension => ( {
4141 extension : extension . slice ( 1 ) ,
4242 isMixedContent : true ,
@@ -60,15 +60,15 @@ export function createCheckerBase(
6060 return baseCreate (
6161 ts ,
6262 ( ) => {
63- const commandLine = vue . createParsedCommandLine ( ts , ts . sys , tsconfig ) ;
63+ const commandLine = core . createParsedCommandLine ( ts , ts . sys , tsconfig ) ;
6464 const { fileNames } = ts . parseJsonSourceFileConfigFileContent (
6565 ts . readJsonConfigFile ( tsconfig , ts . sys . readFile ) ,
6666 ts . sys ,
6767 path . dirname ( tsconfig ) ,
6868 { } ,
6969 tsconfig ,
7070 undefined ,
71- vue . getAllExtensions ( commandLine . vueOptions )
71+ core . getAllExtensions ( commandLine . vueOptions )
7272 . map ( extension => ( {
7373 extension : extension . slice ( 1 ) ,
7474 isMixedContent : true ,
@@ -86,7 +86,7 @@ export function createCheckerBase(
8686function baseCreate (
8787 ts : typeof import ( 'typescript' ) ,
8888 getConfigAndFiles : ( ) => [
89- commandLine : vue . ParsedCommandLine ,
89+ commandLine : core . ParsedCommandLine ,
9090 fileNames : string [ ] ,
9191 ] ,
9292 checkerOptions : MetaCheckerOptions ,
@@ -100,7 +100,7 @@ function baseCreate(
100100 let fileNamesSet = new Set ( fileNames . map ( path => path . replace ( windowsPathReg , '/' ) ) ) ;
101101 let projectVersion = 0 ;
102102
103- vueOptions . globalTypesPath = vue . createGlobalTypesWriter ( vueOptions , ts . sys . writeFile ) ;
103+ vueOptions . globalTypesPath = core . createGlobalTypesWriter ( vueOptions , ts . sys . writeFile ) ;
104104
105105 const projectHost : TypeScriptProjectHost = {
106106 getCurrentDirectory : ( ) => rootPath ,
@@ -123,13 +123,13 @@ function baseCreate(
123123 ] ;
124124 } ;
125125
126- const vueLanguagePlugin = vue . createVueLanguagePlugin < string > (
126+ const vueLanguagePlugin = core . createVueLanguagePlugin < string > (
127127 ts ,
128128 projectHost . getCompilationSettings ( ) ,
129129 vueOptions ,
130130 id => id ,
131131 ) ;
132- const language = vue . createLanguage (
132+ const language = core . createLanguage (
133133 [
134134 vueLanguagePlugin ,
135135 {
@@ -138,7 +138,7 @@ function baseCreate(
138138 } ,
139139 } ,
140140 ] ,
141- new vue . FileMap ( ts . sys . useCaseSensitiveFileNames ) ,
141+ new core . FileMap ( ts . sys . useCaseSensitiveFileNames ) ,
142142 fileName => {
143143 let snapshot = scriptSnapshots . get ( fileName ) ;
144144
@@ -210,7 +210,7 @@ function baseCreate(
210210 } ,
211211 reload ( ) {
212212 [ { vueOptions, options, projectReferences } , fileNames ] = getConfigAndFiles ( ) ;
213- vueOptions . globalTypesPath = vue . createGlobalTypesWriter ( vueOptions , ts . sys . writeFile ) ;
213+ vueOptions . globalTypesPath = core . createGlobalTypesWriter ( vueOptions , ts . sys . writeFile ) ;
214214 fileNamesSet = new Set ( fileNames . map ( path => path . replace ( windowsPathReg , '/' ) ) ) ;
215215 this . clearCache ( ) ;
216216 } ,
@@ -348,7 +348,7 @@ interface ComponentMeta<T> {
348348
349349 const vueFile = sourceScript . generated ?. root ;
350350 const vueDefaults = vueFile && exportName === 'default'
351- ? ( vueFile instanceof vue . VueVirtualCode ? readVueComponentDefaultProps ( vueFile , printer , ts ) : { } )
351+ ? ( vueFile instanceof core . VueVirtualCode ? readVueComponentDefaultProps ( vueFile , printer , ts ) : { } )
352352 : { } ;
353353 const tsDefaults = ! vueFile
354354 ? readTsComponentDefaultProps (
@@ -493,7 +493,7 @@ function createSchemaResolvers(
493493 symbolNode : ts . Expression ,
494494 { rawType, schema : options , noDeclarations } : MetaCheckerOptions ,
495495 ts : typeof import ( 'typescript' ) ,
496- language : vue . Language < string > ,
496+ language : core . Language < string > ,
497497) {
498498 const visited = new Set < ts . Type > ( ) ;
499499
@@ -758,7 +758,7 @@ function createSchemaResolvers(
758758}
759759
760760function readVueComponentDefaultProps (
761- root : vue . VueVirtualCode ,
761+ root : core . VueVirtualCode ,
762762 printer : ts . Printer | undefined ,
763763 ts : typeof import ( 'typescript' ) ,
764764) {
@@ -779,7 +779,7 @@ function readVueComponentDefaultProps(
779779 }
780780 const { ast } = sfc . scriptSetup ;
781781
782- const codegen = vue . tsCodegen . get ( sfc ) ;
782+ const codegen = core . tsCodegen . get ( sfc ) ;
783783 const scriptSetupRanges = codegen ?. getScriptSetupRanges ( ) ;
784784
785785 if ( scriptSetupRanges ?. withDefaults ?. argNode ) {
0 commit comments