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

Code completion not working #177

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

Code completion not working #177

maschere opened this issue Mar 3, 2021 · 6 comments
Labels
Help Wanted We have very little time and would like some help High Priority Very high priority and would like to fix ASAP

Comments

@maschere
Copy link

maschere commented Mar 3, 2021

Description

Code completion window does not show after pressing ctrl + space. It works fine in Processing 3.5.4

Expected Behavior

Code completion window pops up after pressing ctrl + space

Steps to Reproduce

  1. open blank project
  2. enable "code completion with ctrl+space" in preferences
  3. type int testvar = 1;
  4. type testv in the next line and then press ctrl+space

Your Environment

  • Processing version: 4.0a3
  • Operating System and OS version: Windows 10 x64
@benfry
Copy link
Owner

benfry commented Jun 14, 2021

Confirmed to be broken in the current source.

@sampottinger it looks like this was broken back in alpha 1, did you have it working properly?

@benfry
Copy link
Owner

benfry commented Jun 23, 2021

Tracked down to 51145a8, though unfortunately that's the monolithic commit for the JDK support, ANTLR updates, etc, so it's still hard to know if this is a large problem or just something overlooked.

The internal issue is that javaCode is not being set when the code cannot compile, which for code completion is always the case. So there's a NullPointerException when that's accessed, and no completions are available. Hoping that there's a simple fix to get the incomplete code assigned to the variable, and we can get this working again.

@benfry benfry added Help Wanted We have very little time and would like some help High Priority Very high priority and would like to fix ASAP labels Jun 23, 2021
@sampottinger
Copy link
Collaborator

Hey there! It appears that antlr gives up before it can apply the text transformations. I have a branch over at #219 that demonstrates allowing the the text transformation process to continue. That said, antlr does appear to throw out a lot before it is able to recover from a syntax error and my demo only works with the semicolon included at the end. Still working on that.

Screen Shot 2021-07-03 at 3 39 21 PM

sampottinger added a commit that referenced this issue Jul 3, 2021
As part of #177, make sure we continue to walk the tree even when there are errors.
@sampottinger
Copy link
Collaborator

Hey there! Ah dang... right after I sent that @benfry, I realized there was another place we could be dropping the tree and, indeed, fixing that brought back autocomplete. See #219.

@maschere, thank you for this report (and your patience). I have used your test case in the attached example.

Screen Shot 2021-07-03 at 4 50 42 PM

benfry added a commit that referenced this issue Jul 4, 2021
@benfry
Copy link
Owner

benfry commented Jul 4, 2021

Phew, working again. Thanks @sampottinger!

(This will be in for the release that comes after alpha 5; which will be called alpha 6 or beta 1.)

@benfry benfry closed this as completed Jul 4, 2021
@github-actions
Copy link

github-actions bot commented Aug 3, 2021

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Help Wanted We have very little time and would like some help High Priority Very high priority and would like to fix ASAP
Projects
None yet
Development

No branches or pull requests

3 participants