From b43c3794cdf5a937696f97c1dfd363ffbd607722 Mon Sep 17 00:00:00 2001 From: Georg Schwarz Date: Tue, 16 Jan 2024 12:50:49 +0100 Subject: [PATCH] Improve validation message on incompatible types in pipe --- .../src/lib/validation/checks/pipe-definition.spec.ts | 2 +- .../src/lib/validation/checks/pipe-definition.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/language-server/src/lib/validation/checks/pipe-definition.spec.ts b/libs/language-server/src/lib/validation/checks/pipe-definition.spec.ts index 840acef44..28952ae66 100644 --- a/libs/language-server/src/lib/validation/checks/pipe-definition.spec.ts +++ b/libs/language-server/src/lib/validation/checks/pipe-definition.spec.ts @@ -91,7 +91,7 @@ describe('Validation of PipeDefinition', () => { expect(validationAcceptorMock).toHaveBeenNthCalledWith( 2, 'error', - `The output type "File" of TestFileExtractor is incompatible with the input type "Table" of TestTableLoader`, + 'The output type "File" of block "TestExtractor" (of type "TestFileExtractor") is not compatible with the input type "Table" of block "TestLoader" (of type "TestTableLoader")', expect.any(Object), ); }); diff --git a/libs/language-server/src/lib/validation/checks/pipe-definition.ts b/libs/language-server/src/lib/validation/checks/pipe-definition.ts index fd320f2b7..c1fc581dd 100644 --- a/libs/language-server/src/lib/validation/checks/pipe-definition.ts +++ b/libs/language-server/src/lib/validation/checks/pipe-definition.ts @@ -51,7 +51,7 @@ function checkBlockCompatibility( } if (!fromBlockType.canBeConnectedTo(toBlockType)) { - const errorMessage = `The output type "${fromBlockType.outputType}" of ${fromBlockType.type} is incompatible with the input type "${toBlockType.inputType}" of ${toBlockType.type}`; + const errorMessage = `The output type "${fromBlockType.outputType}" of block "${pipeWrapper.from?.name}" (of type "${fromBlockType.astNode.name}") is not compatible with the input type "${toBlockType.inputType}" of block "${pipeWrapper.to?.name}" (of type "${toBlockType.astNode.name}")`; context.accept('error', errorMessage, pipeWrapper.getFromDiagnostic()); context.accept('error', errorMessage, pipeWrapper.getToDiagnostic()); }