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

java.settings.url preference not working #1939

Closed
carlgmz opened this issue May 10, 2021 · 4 comments · Fixed by eclipse-jdtls/eclipse.jdt.ls#1768
Closed

java.settings.url preference not working #1939

carlgmz opened this issue May 10, 2021 · 4 comments · Fixed by eclipse-jdtls/eclipse.jdt.ls#1768
Assignees
Milestone

Comments

@carlgmz
Copy link

carlgmz commented May 10, 2021

I want to disable globally the warning org.eclipse.jdt.core.compiler.problem.staticAccessReceiver. For that, I have set the preference in Eclipse, exported the preference file from Eclipse, and set the property java.settings.url to the exported file (I tried both a file:// URL and the absolute path). In both cases, the extension shows the disabled warning in the problems view.

Environment
  • Operating System: Arch Linux 5.12.1-arch1-1 on x86_64
  • JDK version: 11.0.11
  • Visual Studio Code version: 1.56.0
  • Java extension version: 0.79.1

settings.prefs.txt

Steps To Reproduce
  1. Set the global preferences to the attached file
  2. Write Java code accessing a static field through an object instance.
Current Result

The static access warning is reported

Expected Result

The warning is not reported

Additional Informations

If the preference is set in the project's prefs file, it is honored.

@snjeza snjeza self-assigned this May 10, 2021
@rgrunber
Copy link
Member

rgrunber commented May 10, 2021

One case I'm aware of that has issues is modifying java.settings.url through some external tool (eg. some other editor) while VSCode is running. It came down to having trouble responding to changes in external files (hence why project-level files work). For example, eclipse-jdtls/eclipse.jdt.ls#1579 (comment)

Not sure if this that situation, but I've seen such behaviour.

@snjeza
Copy link
Contributor

snjeza commented May 10, 2021

@carlgmz could you try
settings.prefs.txt

@carlgmz
Copy link
Author

carlgmz commented May 11, 2021

Thank you, @snjeza, that worked.

I see the format is plain preferences, instead of the format produced by the Eclipse preference exportation (I was using Eclipse 2021-03). I think the Setting global preferences guide should be updated.

Thank you!

@carlgmz carlgmz closed this as completed May 11, 2021
@snjeza
Copy link
Contributor

snjeza commented May 11, 2021

@carlgmz There is a bug. I'm preparing a fix.

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 a pull request may close this issue.

3 participants