@@ -123,11 +123,6 @@ function handleWebviewMessage(message: WebviewToExtensionMessage): void {
123123 return ;
124124 }
125125
126- if ( currentPanelState . blockedByMetaschema ) {
127- vscode . window . showErrorMessage ( 'Cannot format schema: Metaschema validation failed. Fix metaschema errors first.' ) ;
128- return ;
129- }
130-
131126 // Send format loading state only, preserve existing lint/metaschema state
132127 panelManager . updateContent ( {
133128 ...currentPanelState ,
@@ -273,44 +268,17 @@ async function updatePanelContent(): Promise<void> {
273268 diagnosticManager . clearDiagnostics ( lastActiveTextEditor . document . uri ) ;
274269 }
275270
276- // Run metaschema first, if metaschema reports errors, block other commands
277271 try {
278272 const version = await commandExecutor . getVersion ( ) ;
279273 cachedCliVersion = version ;
280274
281- const metaschemaRawResult = await commandExecutor . metaschema ( fileInfo . absolutePath ) ;
282- const metaschemaResult = parseMetaschemaResult ( metaschemaRawResult . output , metaschemaRawResult . exitCode ) ;
283-
284- if ( metaschemaResult . errors && metaschemaResult . errors . length > 0 ) {
285- const blockedState : PanelState = {
286- fileInfo,
287- cliVersion : cachedCliVersion ,
288- extensionVersion,
289- lintResult : { raw : '' , health : null , errors : [ ] } ,
290- formatResult : { output : '' , exitCode : null } ,
291- metaschemaResult,
292- isLoading : false ,
293- hasParseErrors : hasJsonParseErrors ( { raw : '' , health : null } , metaschemaResult ) ,
294- blockedByMetaschema : true
295- } ;
296- currentPanelState = blockedState ;
297- panelManager . updateContent ( blockedState ) ;
298-
299- if ( lastActiveTextEditor ) {
300- diagnosticManager . updateMetaschemaDiagnostics (
301- lastActiveTextEditor . document . uri ,
302- metaschemaResult . errors
303- ) ;
304- }
305-
306- return ;
307- }
308-
309- const [ lintOutput , formatResult ] = await Promise . all ( [
275+ const [ metaschemaRawResult , lintOutput , formatResult ] = await Promise . all ( [
276+ commandExecutor . metaschema ( fileInfo . absolutePath ) ,
310277 commandExecutor . lint ( fileInfo . absolutePath ) ,
311278 commandExecutor . formatCheck ( fileInfo . absolutePath )
312279 ] ) ;
313280
281+ const metaschemaResult = parseMetaschemaResult ( metaschemaRawResult . output , metaschemaRawResult . exitCode ) ;
314282 const lintResult = parseLintResult ( lintOutput ) ;
315283
316284 const parseErrors = hasJsonParseErrors ( lintResult , metaschemaResult ) ;
@@ -323,8 +291,7 @@ async function updatePanelContent(): Promise<void> {
323291 formatResult,
324292 metaschemaResult,
325293 isLoading : false ,
326- hasParseErrors : parseErrors ,
327- blockedByMetaschema : false
294+ hasParseErrors : parseErrors
328295 } ;
329296 currentPanelState = finalState ;
330297 panelManager . updateContent ( finalState ) ;
0 commit comments