@@ -8,7 +8,7 @@ type SFCBlock = SFCParseResult['descriptor']['customBlocks'][number];
88
99export function register ( context : vscode . ExtensionContext , client : BaseLanguageClient ) {
1010
11- const getDocDescriptor = useDocDescriptor ( ) ;
11+ const getDocDescriptor = useDocDescriptor ( client ) ;
1212
1313 context . subscriptions . push ( vscode . commands . registerCommand ( 'vue.action.splitEditors' , onSplit ) ) ;
1414
@@ -96,23 +96,23 @@ export function register(context: vscode.ExtensionContext, client: BaseLanguageC
9696 }
9797 }
9898 }
99+ }
99100
100- function useDocDescriptor ( ) {
101+ export function useDocDescriptor ( client : BaseLanguageClient ) {
101102
102- let splitDocText : string | undefined ;
103- let splitDocDescriptor : SFCParseResult | undefined ;
103+ let splitDocText : string | undefined ;
104+ let splitDocDescriptor : SFCParseResult | undefined ;
104105
105- return getDescriptor ;
106+ return getDescriptor ;
106107
107- async function getDescriptor ( text : string ) {
108- if ( text !== splitDocText ) {
109- splitDocText = text ;
110- splitDocDescriptor = await client . sendRequest ( ExecuteCommandRequest . type , {
111- command : commands . parseSfc ,
112- arguments : [ text ] ,
113- } satisfies ExecuteCommandParams ) ;
114- }
115- return splitDocDescriptor ;
108+ async function getDescriptor ( text : string ) {
109+ if ( text !== splitDocText ) {
110+ splitDocText = text ;
111+ splitDocDescriptor = await client . sendRequest ( ExecuteCommandRequest . type , {
112+ command : commands . parseSfc ,
113+ arguments : [ text ] ,
114+ } satisfies ExecuteCommandParams ) ;
116115 }
116+ return splitDocDescriptor ;
117117 }
118118}
0 commit comments