Skip to content

Comments

RFC 0021: Implementation#690

Open
jrentlez wants to merge 3 commits intomainfrom
rfc-0021-impl
Open

RFC 0021: Implementation#690
jrentlez wants to merge 3 commits intomainfrom
rfc-0021-impl

Conversation

@jrentlez
Copy link
Contributor

This PR implements RFC 0021 (#689)

Replaces `Collection<text>` for interpreting tables.
@jrentlez jrentlez self-assigned this Feb 19, 2026
Copy link
Member

@georg-schwarz georg-schwarz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! I'll trigger copilt but good to go from my side!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements RFC 0021, which introduces a new SheetRow type and dot operator (.) syntax for accessing sheet row cells, replacing the previous Collection<text> type and cellInColumn operator. This change simplifies the syntax for row transformations in tabular data processing.

Changes:

  • Introduced new SheetRow primitive value type for representing sheet rows
  • Replaced cellInColumn operator with . operator for cell access (e.g., r . "column" or r . 0)
  • Updated all transform definitions across examples, standard library, and test files to use the new syntax

Reviewed changes

Copilot reviewed 39 out of 39 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
libs/language-server/src/lib/ast/wrappers/value-type/primitive/sheetrow-value-type.ts New SheetRow value type implementation
libs/language-server/src/lib/ast/wrappers/value-type/primitive/primitive-value-type-provider.ts Added SheetRow to primitive type provider
libs/language-server/src/lib/ast/wrappers/value-type/primitive/index.ts Exported SheetRow type
libs/language-server/src/lib/ast/wrappers/value-type/value-type.ts Added visitSheetRow method to visitor interface
libs/language-server/src/lib/ast/expressions/evaluators/dot-operator-evaluator.ts Renamed from CellInColumnOperatorEvaluator to DotOperatorEvaluator
libs/language-server/src/lib/ast/expressions/type-computers/dot-operator-type-computer.ts Renamed from CellInColumnOperatorTypeComputer to DotOperatorTypeComputer
libs/language-server/src/lib/ast/expressions/operator-registry.ts Updated operator registry to use . instead of cellInColumn
libs/language-server/src/grammar/expression.langium Changed grammar to use . operator
libs/language-server/src/lib/validation/checks/transform-body.ts Updated error message (but validation logic needs fix)
libs/language-server/src/lib/ast/wrappers/value-type/primitive/collection/abstract-collection-value-type.ts Removed isReferenceableByUser() override (Collections now non-referenceable by users)
libs/execution/src/lib/types/value-types/visitors/*.ts Added visitSheetRow implementations to all value type visitors
libs/execution/src/lib/transforms/transform-executor.ts Minor refactoring using onlyElementOrUndefined
Multiple .jv example and test files Updated all transform definitions to use SheetRow and . operator
Comments suppressed due to low confidence (1)

libs/language-server/src/lib/validation/checks/transform-body.ts:166

  • The validation logic still checks for Collection<text> type (line 157) but the error message says SheetRow (line 160). The condition should be updated to check for SheetRow instead:

Change line 136-138 from:

const textCollection = props.valueTypeProvider.createCollectionValueTypeOf(
  props.valueTypeProvider.Primitives.Text,
);

to:

const sheetRow = props.valueTypeProvider.Primitives.SheetRow;

And change line 157 from:

if (!inputValueType.equals(textCollection)) {

to:

if (!inputValueType.equals(sheetRow)) {
  const textCollection = props.valueTypeProvider.createCollectionValueTypeOf(
    props.valueTypeProvider.Primitives.Text,
  );

  const input = onlyElementOrUndefined(inputs);
  const inputValueType = props.wrapperFactories.ValueType.wrap(
    input?.valueType,
  );
  assert(input !== undefined);

  if (inputValueType === undefined) {
    props.validationContext.accept(
      'error',
      'Transforms with a table row expression must have exactly one input',
      {
        node: transformBody,
      },
    );
    return;
  }

  if (!inputValueType.equals(textCollection)) {
    props.validationContext.accept(
      'error',
      'This input must be of type `SheetRow',
      {
        node: input.valueType,
      },
    );
    return;
  }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +96 to +98
name: asText (r."name"),
mpg: asDecimal (r . "mpg"),
cyl: asInteger (r.2),
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent spacing around the dot operator. Lines 96 and 98 have no space before the dot (r."name" and r.2), while all other lines have spaces (r . "mpg"). For consistency, standardize the spacing throughout the file. Based on the majority pattern in this file and other files, the correct format should be r . "name" and r . 2 with spaces around the dot operator.

Suggested change
name: asText (r."name"),
mpg: asDecimal (r . "mpg"),
cyl: asInteger (r.2),
name: asText (r . "name"),
mpg: asDecimal (r . "mpg"),
cyl: asInteger (r . 2),

Copilot uses AI. Check for mistakes.
props.validationContext.accept(
'error',
'This input must be of type `Collection<text>',
'This input must be of type `SheetRow',
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message is missing a closing backtick. It should be 'This input must be of type SheetRow' (with a closing backtick after SheetRow).

Suggested change
'This input must be of type `SheetRow',
'This input must be of type `SheetRow`',

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants