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.import.exclusions preference is ignored during server startup #444

Closed
fbricon opened this issue Feb 15, 2018 · 3 comments
Closed

java.import.exclusions preference is ignored during server startup #444

fbricon opened this issue Feb 15, 2018 · 3 comments
Assignees
Labels

Comments

@fbricon
Copy link
Collaborator

fbricon commented Feb 15, 2018

While checking eclipse-jdtls/eclipse.jdt.ls#539, I realized that java.import.exclusions are actually ignored during import, as the import is initialized before the preferences are set. See logs:

[Info  - 16:07:58] 15-Feb-2018 4:07:58 PM >> initialize
[Info  - 16:07:58] 15-Feb-2018 4:07:58 PM Initializing Java Language Server 0.13.0.201802152031
[Info  - 16:07:58] 15-Feb-2018 4:07:58 PM >> workspace/didChangeConfiguration
[Info  - 16:07:58] 15-Feb-2018 4:07:58 PM System property http.nonProxyHosts has been set to local|*.local|169.254/16|*.169.254/16 by an external source. This value will be overwritten using the values from the preferences
[Info  - 16:07:58] 15-Feb-2018 4:07:58 PM Creating the default Java project
[Info  - 16:07:58] 15-Feb-2018 4:07:58 PM Finished creating the default Java project
[Info  - 16:07:59] 15-Feb-2018 4:07:58 PM Workspace initialized in 1492ms
[Info  - 16:08:00] 15-Feb-2018 4:07:58 PM >>New configuration: {java={home=/Users/fbricon/.sdkman/candidates/java/8u141-oracle/, jdt={ls={vmargs=-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication}}, errors={incompleteClasspath={severity=warning}}, configuration={updateBuildConfiguration=interactive, maven={userSettings=null}}, trace={server=off}, import={gradle={enabled=true}, maven={enabled=true}, exclusions=[**/node_modules/**, **/.metadata/**, **/archetype-resources/**, **/META-INF/maven/**]}, referencesCodeLens={enabled=false}, signatureHelp={enabled=false}, implementationsCodeLens={enabled=false}, format={enabled=true}, saveActions={organizeImports=false}, contentProvider={preferred=fernflower}, autobuild={enabled=true}, completion={favoriteStaticMembers=[org.junit.Assert.*, org.junit.Assume.*, org.junit.jupiter.api.Assertions.*, org.junit.jupiter.api.Assumptions.*, org.junit.jupiter.api.DynamicContainer.*, org.junit.jupiter.api.DynamicTest.*], importOrder=[java, javax, com, org]}, telemetry={enabled=true}}}

New configuration is set after workspace is initialized.

@fbricon fbricon added the bug label Feb 15, 2018
@fbricon
Copy link
Collaborator Author

fbricon commented Feb 15, 2018

@aeschli can we send the server configuration during initialization, before the 1st call to workspace/didChangeConfiguration?

@aeschli
Copy link
Collaborator

aeschli commented Feb 15, 2018

@fbricon Yes, you can put custom properties in the init request, see initializationOptions.
https://github.com/Microsoft/language-server-protocol/blob/gh-pages/specification.md#initialize-request-leftwards_arrow_with_hook

@aeschli aeschli closed this as completed Feb 15, 2018
@aeschli aeschli reopened this Feb 15, 2018
@fbricon
Copy link
Collaborator Author

fbricon commented Feb 15, 2018

@aeschli thanks for the pointer. @snjeza can you take this one? We'll have to document the expected behaviour on the server side for 3rd party adopters (cc @tsmaeder)

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

No branches or pull requests

3 participants