TabularEditor / TabularEditor3

Bug reports, feature requests, discussion and documentation for Tabular Editor 3 (commercial version).
61 stars 7 forks source link

Red Error lines in the Expression Editor Appearing. #1173

Closed CraigsterT closed 5 months ago

CraigsterT commented 5 months ago

Description

When writing a measure which includes variables in the expression editor the red error lines appear and persist until you move forward to your next variable. Then the error lines seem to disappear but move onto the next variable and so forth until you have completed your measure. It's a little off putting when writing the code as you do stare at the variable you have just wrote wondering what the error may be when there is in fact nothing wrong with it. Once you finalise the measure with return the red error lines seem to disappear , though . I am not sure if Tabular Editor has now just become super sensitive to variables in some way as a result of the new functionality introduced to detect unused variables. It would be great if we could clear this up and the expression editor could revert back to only identifying true errors in the code , please. I think this could speed up the process of creating measures, avoid the developer send guessing themselves and eliminate any doubts with their code and improve productivity.

Tabular Editor 3 Version

3.12.0

Screenshots

No response

Steps to Reproduce

Simply write a measure in the expression editor that contains variables.

Expected behavior

Same as before , please. Red error lines only of there is a 'true' error, please.

Crash Report

No response

Windows Version

No response

otykier commented 5 months ago

@CraigsterT just to clarify, is this showing up as an error or a warning? In my tests, unused variables should only produce warnings, not errors:

image

That being said, we could probably improve this, so the warning isn't showed until the variable block has been completed (including the RETURN statement). Or even add an option to disable unused variable warnings (i.e. same behavior as pre-3.12.0)

CraigsterT commented 5 months ago

image Hi Daniel , No, it seems to be that if you have not completed the subsequent variable in your code that you have this red line appearing as in my screen shot, In this , I just need to add the customer segment table argument to calculate and then after I complete the code with good old 'Return Result' then the red line vanishes and it appears that I am now good to go but up until that point it does appear as though Tabular Editor is telling me that I have written some rubbish code and that I have absolutely no chance with the measure I am writing , that's what makes it very off putting and slows you down quite a bit ,while you examine your code with the potential to second guess yourself and then write some rubbish code in order to get rid of the red lines. Which isn't going to happen. Please try the code that I snipped and tell me what you think please. All the best and speak soon.

otykier commented 5 months ago

Yeah, currently the squiggly line will appear throughout the variable expression, until the variable is referenced somewhere. I believe the following changes would be better:

  1. If there are no references to the variable, we only show the squiggly line under the variable name, not the full expression assigned to the variable:

    VAR CustomerSegments = FILTER( ... )

  2. We only perform this validation once the RETURN statement is added to the code and no other errors are present. This way, you won't see the squiggly line while typing out the code.

What do you think about that solution?

CraigsterT commented 5 months ago

Hi Daniel, Sorry for the delay in responding. The solution to the issue that you have provided sounds very good. I think a feint red line, similar to the one we see now underneath the expression, but instead underneath the variable name would be a very good solution. I don't believe that this will be as distracting or confusing as when it appears below each line of the expression. I look forward to seeing it at some point in the near future. Thanks for your time and assistance in resolving the issue. I guess just like DAX itself, it's the small details that make a world of difference. Thanks again and kind regards Craig.

On Fri, Dec 1, 2023 at 8:11 AM Daniel Otykier @.***> wrote:

Yeah, currently the squiggly line will appear throughout the variable expression, until the variable is referenced somewhere. I believe the following changes would be better:

1.

If there are no references to the variable, we only show the squiggly line under the variable name, not the full expression assigned to the variable:

VAR CustomerSegments = FILTER( ... ) 2.

We only perform this validation once the RETURN statement is added to the code and no other errors are present. This way, you won't see the squiggly line while typing out the code.

What do you think about that solution?

— Reply to this email directly, view it on GitHub https://github.com/TabularEditor/TabularEditor3/issues/1173#issuecomment-1835656106, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP2MVAUVCK2235VVH6OPPATYHGGM3AVCNFSM6AAAAAA74VEB3WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZVGY2TMMJQGY . You are receiving this because you were mentioned.Message ID: @.***>

CraigsterT commented 5 months ago

Hi Daniel , A big thank you to you. Works perfectly. Have a great Xmas, Craig.

mlonsk commented 5 months ago

Hi @CraigsterT Thank you for suggesting the improvement! Happy holidays to you too!