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

ContentAssist / CompletionScanner running into deadlock #1194

Merged
merged 1 commit into from
Jun 28, 2023

Conversation

srikanth-sankaran
Copy link
Contributor

@srikanth-sankaran srikanth-sankaran commented Jun 28, 2023

What it does

Author checklist

@srikanth-sankaran srikanth-sankaran self-assigned this Jun 28, 2023
@srikanth-sankaran srikanth-sankaran added this to the 4.29 M1 milestone Jun 28, 2023
@srikanth-sankaran
Copy link
Contributor Author

srikanth-sankaran commented Jun 28, 2023

In the method org.eclipse.jdt.internal.codeassist.impl.AssistParser.fallBackToSpringForward(Statement), there is a comment that reads:

// OK, next token is no good to resume "in place", attempt some local repair. FIXME: need to make sure we don't get stuck keep reducing empty statements !! - this was added by me in 2014 November - my last month in inning no. 1, it has taken a long while to get to inning no. 2 and to the FIXME :-(

Anyways, code completion is an extremely complex area nothing short of dark magic as it stands - there is so little good quality documentation on it, there is so much global state that is scattered in bits and pieces each dealing with some corner case or other. Each successive maintainer has tried (and failed IMHO) to unearth the design and has ended up adding his own complex layers on top.

This is not an intractable area in truth, but in practice very much so because most committers have no time to grasp the full picture, but do as well as the blind men in the fable with elephants.

The present ticket is even more tricky - CompletionParser ends up seeing lambdas where there are none! Things go downhill pretty quickly from there. I have added the smarts to detect where recovery is not progressing at all despite our attempts to nudge it along - by tracking the parser's and scanner's state to deduce deadlock and break free.

This would prevent eclipse from hanging. (There are no useful completion proposals at the site)

@srikanth-sankaran srikanth-sankaran merged commit 5982baf into eclipse-jdt:master Jun 28, 2023
@srikanth-sankaran srikanth-sankaran deleted the GH1100 branch June 28, 2023 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ContentAssist / CompletionScanner running into deadlock
1 participant