redhat-developer / vscode-quarkus

Quarkus Tools for Visual Studio Code, by Red Hat
https://quarkus.io
Apache License 2.0
72 stars 27 forks source link

Gradle: New config properties not available for newly added Quarkus extensions #211

Open xorye opened 4 years ago

xorye commented 4 years ago

To reproduce this issue:

  1. Create a new Gradle Quarkus project without choosing any extensions to add
  2. Open the Quarkus project in VS Code
  3. Call the Quarkus: Add extensions to current project command
  4. Add an extension (ex. Agroal)
  5. Go to application.properties, invoke completion
  6. Completion options coming from the Agroal extensions do not appear (ex quarkus.datasource.driver)
fbricon commented 4 years ago

vscode-java should ask you to update the project configuration, if build.gradle changed.

angelozerr commented 4 years ago

@xorye I suspect a problem with evict cache (cache is not evicted when there is an error coming from JDT LS extension side). Perhaps it's a usecase when there is an error on JDT LS extension side?

Could you please test my draft PR https://github.com/redhat-developer/quarkus-ls/pull/227 with your usecase, thanks.

xorye commented 4 years ago

Here is what I did:

  1. Open a new Quarkus Gradle project with no extra extensions added.

  2. Invoke completion to verify that quarkus.datasource.* completion items don't appear (as expected)

  3. Add the Agroal - Database connection pool Quarkus extension with the Quarkus: Add extensions to current Quarkus project command

  4. Press 'now' when this pops up: image

  5. Invoke completion.

After invoking completion in step 5. the quarkus.datasource.* completion items are missing.

@angelozerr I tried the above with your draft PR and had the same issue.

Here is the server trace (it looks fine to me): https://gist.github.com/xorye/df9706b51c3f21a88217dc18af1de0cc

angelozerr commented 4 years ago

Here is the server trace (it looks fine to me)

No it's not good, you should have a 'microprofile/propertiesChanged'

[Trace - 18:31:10] Sending notification 'microprofile/propertiesChanged'.
Params: {
    "type": [
        1,
        2
    ],
    "projectURIs": [
        "C:\\Users\\azerr\\git\\quarkus-ls\\microprofile.jdt\\com.redhat.microprofile.jdt.test\\projects\\gradle\\quarkus-gradle-project"
    ]
}
xorye commented 4 years ago

I've looked into this problem once more, here is what I've found:

In a clean Quarkus Gradle project, I have added the Agroal extension. In the "Java Dependencies" view, I am missing the Agroal jar, and I am not receiving Agroal completion items in my Java class and in application.properties:

Gif showing the problem

Here are some screenshots from a separate project, outlining what I was missing from the gif above (AKA, what I expected to happen when adding the Agroal extension):

These are the Agroal jars that were missing: image

Here are some Agroal completion items that were missing in my resource class: image

Here are some Agroal completion items that were missing in my application.properties file: image

xorye commented 4 years ago

I've noticed this issue sometimes happens, sometimes doesn't.

Here is the Java Build Status when the issue does not happen:

22f368e4 Synchronizing Gradle build at /home/dakwon/git/redhat-developer-forks/quarkus-gradle-111111 [Done]
d2749ea1 Repository registry initialization [Done]
f9e3d2ec Synchronizing projects [Done]
82e0265f Updating indexes [Done]
8acbe519 Building [Done]
48558b7f Refreshing Maven model [Done]
91292ceb Building [Done]
***NOTE: The following lines happen right after adding the Agroal extension***
77b3752b Building [Done]
cefa6162 Synchronizing Gradle build at /home/dakwon/git/redhat-developer-forks/quarkus-gradle-111111 [Done]
0bddc829 Building [Done]
c7876bf2 Building [Done]
6754681f Building [Done]
84e3c27b Register Watchers [Done]
3e40635f Building [Done]

Here is the Java Build Status when the issue happens:

6a5bd064 Synchronizing projects [Done]
081277d4 Refreshing Maven model [Done]
46df96d7 Synchronizing Gradle build at /home/dakwon/Documents/QuarkusExtTesting/quarkus-gradle-1111111 [Done]
a14b671d Repository registry initialization [Done]
24bc08b7 Updating indexes [Done]
d4310436 Building [Done]
***NOTE: The following line happen right after adding the Agroal extension***
3285e7ab Building [Done]

When the issue does happen, the Synchronizing Gradle build log is missing.

xorye commented 4 years ago

I can't reproduce this on my machines at the moment. Once I have access to the original machine that I experienced this issue with (tomorrow), I will provide an update and possibly create an issue at https://github.com/eclipse/eclipse.jdt.ls