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

Autocompletion overwrites following characters #416

Merged
merged 1 commit into from
Nov 1, 2017

Conversation

snjeza
Copy link
Contributor

@snjeza snjeza commented Nov 1, 2017

Fixes redhat-developer/vscode-java#352

Signed-off-by: Snjezana Peco [email protected]

@snjeza snjeza requested review from gorkem and fbricon November 1, 2017 17:23
@@ -475,6 +476,13 @@ public void didOpen(DidOpenTextDocumentParams params) {
@Override
public void didChange(DidChangeTextDocumentParams params) {
logInfo(">> document/didChange");
try {
Job.getJobManager().join(DocumentLifeCycleHandler.DOCUMENT_LIFE_CYCLE_JOBS, new NullProgressMonitor());
Copy link
Contributor

@fbricon fbricon Nov 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the fix works as expected, I'm a bit worried about joining on a job without possibilities to cancel. Are there any other alternatives?

@snjeza snjeza force-pushed the issue-352 branch 2 times, most recently from 6193c05 to 43a6afa Compare November 1, 2017 19:20
jobs = Job.getJobManager().find(DocumentLifeCycleHandler.DOCUMENT_LIFE_CYCLE_JOBS);
wait = (System.currentTimeMillis() - start) < 5000 && jobs.length > 0;
if (wait) {
Thread.sleep(400);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sleep 100ms

And we should probably move that piece of code to the JobHelper, which itself needs to move from tests to core.

@fbricon
Copy link
Contributor

fbricon commented Nov 1, 2017

This change completely kills autocompletion, we need to find something else.

@snjeza snjeza force-pushed the issue-352 branch 2 times, most recently from 24e9c2c to 932e948 Compare November 1, 2017 22:30
@fbricon fbricon merged commit 1716e00 into eclipse-jdtls:master Nov 1, 2017
@snjeza snjeza deleted the issue-352 branch November 1, 2017 22:53
} catch (OperationCanceledException ignorable) {
// No need to pollute logs when query is cancelled
} catch (InterruptedException e) {
JavaLanguageServerPlugin.logException(e.getMessage(), e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget the Thread.currentThread().interrupt();

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.

3 participants