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

[Bug] Code completion for "try:" snippets have a syntax error #213

Closed
BertLindeman opened this issue Jan 15, 2021 · 6 comments
Closed

[Bug] Code completion for "try:" snippets have a syntax error #213

BertLindeman opened this issue Jan 15, 2021 · 6 comments
Labels
bug Something isn't working software: pybricks-code Issues with https://code.pybricks.com application

Comments

@BertLindeman
Copy link

Describe the bug
Code completion snippets for try: are refused

To reproduce
Steps to reproduce the behavior:

  1. go to code.pybricks.com
  2. in the source area type the word try
  3. choose a completion snippet, see the first screenshot
  4. run the code
  5. See the syntax error (second screenshot)

Expected behavior
Correct syntax, e.g. like the third screenshot

the snippet has

except Exception, e:

and should be:

except Exception as e:

Screenshots
image

image

image

@BertLindeman BertLindeman added the triage Issues that have not been triaged yet label Jan 15, 2021
@laurensvalk laurensvalk added software: pybricks-code Issues with https://code.pybricks.com application bug Something isn't working and removed triage Issues that have not been triaged yet labels Jan 15, 2021
@dlech
Copy link
Member

dlech commented Jan 15, 2021

The first part of the error message in the screenshot looks like a server configuration error on our side.

@dlech
Copy link
Member

dlech commented Jan 15, 2021

@BertLindeman would you like to make a pull request to fix this?

Click on the edit button (pencil icon) in https://github.com/pybricks/pybricks-code/blob/master/src/components/editor-snippets.ts

@BertLindeman
Copy link
Author

Will try ;-)

@BertLindeman
Copy link
Author

I do not completely understand the file, but it's not so difficult to change a comma into as
PR #243 made.

@dlech
Copy link
Member

dlech commented Jan 15, 2021

I had no doubts that you could handle it. 😉

dlech pushed a commit to pybricks/pybricks-code that referenced this issue Jan 15, 2021
Fix Code completion for "try:" snippets have a syntax error pybricks/support#213
@BertLindeman
Copy link
Author

Got a neat message on code.pybricks.com:

New content is available and will be used when all tabs for this page are closed.'

Did ctrl-F5 to reload.
Used all try variants and no more syntax errors.
Closing . . .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working software: pybricks-code Issues with https://code.pybricks.com application
Projects
None yet
Development

No branches or pull requests

3 participants