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

No Check Model functionality in 5.x #1800

Closed
smk78 opened this issue Mar 3, 2021 · 6 comments
Closed

No Check Model functionality in 5.x #1800

smk78 opened this issue Mar 3, 2021 · 6 comments
Assignees
Labels
Defect Bug or undesirable behaviour For Feature Parity Issues to give 5x the same functionality as 4x

Comments

@smk78
Copy link
Contributor

smk78 commented Mar 3, 2021

In 4.x, the Advanced Plugin Model Editor incorporates functionality to check the validity of the code in the selected plugin (Run > Check Model):

image

The output is extremely valuable for debugging plugin models:

image

In this instance, for example, highlighting that the User had used define random(): instead of def random():

In 4.x this output is not duplicated in either the Console or sasview.txt.

Unfortunately there is no equivalent Check Model functionality in 5.x (the following screenshots are from 5.04 RC3):

image

image

The issue here is that if 5.x cannot compile a plugin then it simply passes over it. Nothing to say it could not compile a plugin is output to the Log Explorer or sasview.txt. This actually makes 5.x pretty much useless for developing or tweaking a plugin by editing the code.

Can the Check Model functionality be reinstated in 5.x?

@smk78 smk78 added Defect Bug or undesirable behaviour For Feature Parity Issues to give 5x the same functionality as 4x labels Mar 3, 2021
@smk78 smk78 added this to the SasView Next Release +1 milestone Mar 3, 2021
@rozyczko
Copy link
Member

rozyczko commented Mar 3, 2021

Yes, this is indeed missing. Wx had a nice python editor/syntax checker built in, but Qt has nothing like that so far.
Reimplementing this functionality in Qt will be a pretty hefty effort, unless there is a ready component out there we can reuse.

@rozyczko
Copy link
Member

rozyczko commented Mar 3, 2021

QScintilla2 might be a solution to that... investigating

@rozyczko
Copy link
Member

using ast along with showing the results with traceback seems to be doing the trick.

@butlerpd
Copy link
Member

Just did a quick search on ast -- that does seem promising!!

@rozyczko
Copy link
Member

Added a syntax check for the edit model window.
Also, added support for line numbers and current row highlighting

branch: improved_model_check

@krzywon
Copy link
Contributor

krzywon commented Jul 6, 2021

This was fixed with #1875

@krzywon krzywon closed this as completed Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defect Bug or undesirable behaviour For Feature Parity Issues to give 5x the same functionality as 4x
Projects
None yet
Development

No branches or pull requests

4 participants