@@ -16,7 +16,7 @@ import {
1616} from 'reactive-vscode' ;
1717import * as vscode from 'vscode' ;
1818import { config } from './lib/config' ;
19- import { activate as activateWelcome , executeWelcome } from './lib/welcome' ;
19+ import * as welcome from './lib/welcome' ;
2020
2121let client : lsp . BaseLanguageClient | undefined ;
2222let needRestart = false ;
4040 }
4141}
4242
43- export const { activate , deactivate } = defineExtension ( ( ) => {
43+ export = defineExtension ( ( ) => {
4444 const context = extensionContext . value ! ;
4545 const volarLabs = createLabsInfo ( ) ;
4646 const activeTextEditor = useActiveTextEditor ( ) ;
@@ -98,10 +98,10 @@ export const { activate, deactivate } = defineExtension(() => {
9898
9999 activateAutoInsertion ( selectors , client ) ;
100100 activateDocumentDropEdit ( selectors , client ) ;
101- activateWelcome ( context ) ;
101+ welcome . activate ( context ) ;
102102 } , { immediate : true } ) ;
103103
104- useCommand ( 'vue.welcome' , ( ) => executeWelcome ( context ) ) ;
104+ useCommand ( 'vue.welcome' , ( ) => welcome . execute ( context ) ) ;
105105 useCommand ( 'vue.action.restartServer' , async ( ) => {
106106 await executeCommand ( 'typescript.restartTsServer' ) ;
107107 await client ?. stop ( ) ;
@@ -183,9 +183,9 @@ else {
183183 const extensionJsPath = require . resolve ( './dist/extension.js' , {
184184 paths : [ tsExtension . extensionPath ] ,
185185 } ) ;
186+ const vuePluginName = require ( './package.json' ) . contributes . typescriptServerPlugins [ 0 ] . name ;
186187
187- // @ts -expect-error
188- fs . readFileSync = ( ...args ) => {
188+ fs . readFileSync = ( ...args : any [ ] ) => {
189189 if ( args [ 0 ] === extensionJsPath ) {
190190 let text = readFileSync ( ...args ) as string ;
191191
@@ -194,7 +194,7 @@ else {
194194 'languages:Array.isArray(e.languages)' ,
195195 [
196196 'languages:' ,
197- `e.name==='vue-typescript-plugin-pack '?[${
197+ `e.name==='${ vuePluginName } '?[${
198198 config . server . includeLanguages
199199 . map ( lang => `'${ lang } '` )
200200 . join ( ',' )
@@ -215,7 +215,6 @@ else {
215215 ) ;
216216
217217 // sort plugins for johnsoncodehk.tsslint, zardoy.ts-essential-plugins
218- const vuePluginName = require ( './package.json' ) . contributes . typescriptServerPlugins [ 0 ] . name ;
219218 text = text . replace (
220219 '"--globalPlugins",i.plugins' ,
221220 s => s + `.sort((a,b)=>(b.name==="${ vuePluginName } "?-1:0)-(a.name==="${ vuePluginName } "?-1:0))` ,
0 commit comments