Skip to content

Commit 54f6193

Browse files
committed
Change status to notification. fix compilation logic
1 parent 410aabf commit 54f6193

1 file changed

Lines changed: 22 additions & 4 deletions

File tree

firebase-vscode/src/data-connect/execution/execution.ts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,25 @@ export function registerExecution(
325325
configDir: serviceConfig.path,
326326
projectId: arg.projectId,
327327
});
328-
if (buildResult.errors?.length) {
328+
const schemaErrors = buildResult.errors?.filter(e => {
329+
// Ignore warnings
330+
const isHardError = !e.extensions?.warningLevel;
331+
const file = e.extensions?.file;
332+
if (!file) return isHardError;
333+
334+
// Ignore operation (connector) errors, only keep schema errors
335+
const isSchemaFile = !serviceConfig.connectorDirs.some(dir => {
336+
const absConnectorDir = path.resolve(serviceConfig.path, dir);
337+
const absFile = path.resolve(serviceConfig.path, file);
338+
return absFile.startsWith(absConnectorDir);
339+
});
340+
341+
return isHardError && isSchemaFile;
342+
});
343+
344+
if (schemaErrors?.length) {
329345
// Handle compilation errors and provide navigation to the file
330-
await handleCompilationError(buildResult.errors[0], serviceConfig.path);
346+
await handleCompilationError(schemaErrors[0], serviceConfig.path);
331347
return;
332348
}
333349
} catch (e: any) {
@@ -348,7 +364,7 @@ ${arg.existingQuery ? `\n\nRefine this existing operation:\n${arg.existingQuery}
348364
}
349365
}
350366
const res = await vscode.window.withProgress({
351-
location: vscode.ProgressLocation.Window,
367+
location: vscode.ProgressLocation.Notification,
352368
title: "Data Connect: Generating Operation...",
353369
}, async (progress) => {
354370
return await gif.generateOperation(
@@ -379,6 +395,7 @@ ${arg.existingQuery ? `\n\nRefine this existing operation:\n${arg.existingQuery}
379395
arg.existingQuery,
380396
res,
381397
);
398+
vscode.window.showInformationMessage("SQL Connect generation completed");
382399
} catch (e: any) {
383400
vscode.window.showErrorMessage(`Failed to generate query: ${e.message}`);
384401
}
@@ -404,7 +421,7 @@ ${arg.existingQuery ? `\n\nRefine this existing operation:\n${arg.existingQuery}
404421
}
405422

406423
const res = await vscode.window.withProgress({
407-
location: vscode.ProgressLocation.Window,
424+
location: vscode.ProgressLocation.Notification,
408425
title: "Data Connect: Generating Schema...",
409426
}, async (progress) => {
410427
return await gif.generateSchema(
@@ -434,6 +451,7 @@ ${arg.existingQuery ? `\n\nRefine this existing operation:\n${arg.existingQuery}
434451
"", // No existing query to replace
435452
res,
436453
);
454+
vscode.window.showInformationMessage("SQL Connect generation completed");
437455
} catch (e: any) {
438456
vscode.window.showErrorMessage(`Failed to generate schema: ${e.message}`);
439457
}

0 commit comments

Comments
 (0)