Skip to content

Expanding a measure inline that has a comment at the end can result in invalid code #1494

@edhans

Description

@edhans

Description

I am not sure if this is a bug per se, because I think putting comments at the end of expressions is a bad practice.

If a measure has a comment as the last line, and you expand that measure Inline, if there was a comma after the measure, the comma (or any other code) will get commented out resulting in an invalid expression. See the screenshot.

Tabular Editor 3 Version

3.23.1

Screenshots

The [Margin] measure has a comment at the end of it. Watch what happens when you expand it inline:

Image

Steps to Reproduce

  1. Put a comment at the bottom of a measure
  2. Reference that measure in another measure in a DIVIDE() in the numerator so the comma is affected.
  3. Expand the measure inline

It could also be the denominator. In that case the final parens is commented out. This is just one example.

Expected behavior

What it should do is after the inline expand, everything after it should be moved to another line, not kept on the same line as the last line of code expanded inline.

Crash Report

No response

Windows Version

11

Metadata

Metadata

Assignees

No one assigned

    Labels

    template: issueIssue report created by user, needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions