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

Broken autocomplete when writing in a new file in a new directory #3194

Closed
rohanbari opened this issue Jul 11, 2023 · 9 comments
Closed

Broken autocomplete when writing in a new file in a new directory #3194

rohanbari opened this issue Jul 11, 2023 · 9 comments

Comments

@rohanbari
Copy link

rohanbari commented Jul 11, 2023

The extension fails to work appropriately on creating a new file in a new directory. That is, it would not display suggestions further. I thought it was a user-end problem. I tried reinstalling the extension. Yet, it persisted.

Environment
  • Operating System: Linux Mint 21.1 Vera
  • JDK version: javac 17.0.7
  • Visual Studio Code version: 1.80.0
  • Java extension version: v1.20.0 (Language Support for Java by RedHat)
Steps To Reproduce
  1. Open Code with the extensions enabled
  2. Create a new file in a new directory
  3. Start writing code
Image version of the misbehavior

Problem Image

* I don't think it needs a text version here.

Edit: The problem goes away on an app restart.

Java Extension Logs

Logs here

To ease dev work, my intuition says the problems are logged from line no. 19732-'37:

!ENTRY org.eclipse.jdt.ls.core 4 0 2023-07-11 19:09:12.705
!MESSAGE Error occured while building workspace. Details: 
 message: Syntax error, insert ";" to complete BlockStatements; code: 1610612976; resource: /home/rohan/code/java-lang/src/mathematics/FibonacciSeries.java; line: 6
 message: sout cannot be resolved; code: 570425394; resource: /home/rohan/code/java-lang/src/mathematics/FibonacciSeries.java; line: 6
 message: Syntax error, insert "VariableDeclarators" to complete LocalVariableDeclaration; code: 1610612976; resource: /home/rohan/code/java-lang/src/mathematics/FibonacciSeries.java; line: 6
Expected Result

Anyone would expect some suggestion to appear.

Additional Information

Well, I know contributing is fun.
At this moment in my life, I have no idea what additional information to provide. But yeah, I can say it works correctly sometimes, very unpredictable.

@testforstephen
Copy link
Collaborator

I also encountered this issue a few times. No intellisense in the new Java file. Usually reloading the window can fix it.

@snjeza
Copy link
Contributor

snjeza commented Jul 12, 2023

This is an upstream VS Code issue. I can't reproduce it in VS Code <= 1.79.2.
It is reproducible in VS Code 1.80.0 and code-insiders

@starball5
Copy link

starball5 commented Jul 12, 2023

Related on Stack Overflow:

Help with closing the duplicates would be appreciated if you have the privileges on Stack Overflow to flag or close-vote. That way the answers can be found in one single place instead of spread out everywhere.

@gayanper
Copy link
Contributor

With latest Insider which is 1.81.0 it seems to work.

@starball5
Copy link

Quoting from my answer post on Stack Overflow:

Upon further inspection, I found this issue ticket in the VS Code repo: Are choice snippets dangerous now? Breaking extensions completions #187642, where there has been a regression with choice snippets from commit 3e232a8. Notably, if you look in the release notes for the Red Hat Java Language Support extension, the 1.20.0 section says:

  • enhancement - Use choice syntax as placeholder for constructor/method/field snippets. See #3018, #3140.

@testforstephen
Copy link
Collaborator

@starball5 Great comment, thanks for the information.

@testforstephen
Copy link
Collaborator

With latest Insider which is 1.81.0 it seems to work.

It works for me as well when I use the [email protected] (2023-07-12) version.

@testforstephen
Copy link
Collaborator

Close it since this issue has been fixed in the latest [email protected] version.

@testforstephen testforstephen unpinned this issue Aug 16, 2023
@ChefAharoni
Copy link

Hey,

I'm still having this issue.
My VS Code is updated, I tried uninstalling the Java Extension pack, restarting all extensions, cleaning the workspace, restarting VS Code, and restarting Java Language Server.

Any guidance on how to solve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants