Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Red Error lines in the Expression Editor Appearing. #1173

Closed
CraigsterT opened this issue Nov 27, 2023 · 6 comments
Closed

Red Error lines in the Expression Editor Appearing. #1173

CraigsterT opened this issue Nov 27, 2023 · 6 comments
Labels
feature: enhancement Request is a enchacement to existing feature feature: implemented The feature or enhancement is implemented in TE3

Comments

@CraigsterT
Copy link

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

@CraigsterT CraigsterT added the template: issue Issue report created by user, needs to be triaged label Nov 27, 2023
@otykier
Copy link
Collaborator

otykier commented Nov 28, 2023

@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)

@otykier otykier added issue: awaiting reply More information is needed and removed template: issue Issue report created by user, needs to be triaged labels Nov 28, 2023
@CraigsterT
Copy link
Author

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
Copy link
Collaborator

otykier commented Dec 1, 2023

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?

@otykier otykier added feature: enhancement Request is a enchacement to existing feature and removed issue: awaiting reply More information is needed labels Dec 1, 2023
@CraigsterT
Copy link
Author

CraigsterT commented Dec 2, 2023 via email

@CraigsterT
Copy link
Author

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

@mlonsk mlonsk added the feature: implemented The feature or enhancement is implemented in TE3 label Dec 18, 2023
@mlonsk
Copy link
Collaborator

mlonsk commented Dec 18, 2023

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

@mlonsk mlonsk closed this as completed Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: enhancement Request is a enchacement to existing feature feature: implemented The feature or enhancement is implemented in TE3
Development

No branches or pull requests

3 participants