-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
function/variable "does not exist" errors reported if trying to define a class without setup/draw #579
Comments
Created by: benfry Did this work properly in 3.x? (Paging @sampottinger for possible preproc solutions…) |
Created by: kjhollen Thanks @sampottinger! |
Created by: benfry Merged for 4.0.2; thanks Sam. |
Created by: github-actions[bot] This issue has been automatically locked. To avoid confusion with reports that have already been resolved, closed issues are automatically locked 30 days after the last comment. Please open a new issue for related bugs. |
Created by: kjhollen
Description
I was starting a new project and had a mostly empty file as the main PDE, with the exception of an import for the video library. I created a new file to write a class, and all references to Processing functions & variables were red underlined as errors. Error messages were, for example, "mouseX does not exist", despite syntax highlighting picking them up correctly. I was able to make this go away by adding empty setup() and draw() definitions in the main PDE file.
Expected Behavior
A descriptive error suggesting to define setup() and draw() in the appropriate file before defining a class that depends on Processing variables and functions.
Current Behavior
App says library variables and function names like ellipse() and mouseX do not exist.
Steps to Reproduce
Here's the code used in my second tab that reproduces the error:
mouseX, mouseY, and ellipse() will show as errors, hovering/clicking for more detail says "does not exist"
Your Environment
Possible Causes / Solutions
Based on what I remember about how Processing parses the main sketch file depending on whether or not setup() or draw() are defined, I think it makes sense that it wouldn't be possible to define a (nested) class without formally defining setup()/draw(). But, initially I thought this was some kind of parsing error and restarted the app to see if it would go away. I'm not suggesting there's a mode of use that justifies defining a class without setup()/draw(), just that a more descriptive error message would be useful when this happens.
The text was updated successfully, but these errors were encountered: