Open hanczaryk opened 1 year ago
I looked into this issue further and tried out a few scenarios. I believe the issue is with the location of the properties file.
If you have have META-INF/microprofile-config.properties
under resources
and not under webapp
, the LSP4MP language server will pick it up. Not so for where Brian has his properties file if I am not mistaken.
This isn't an issue with Liberty Tools for VS Code. It should be with the language server (LSP4MP) available through Tools for MicroProfile extension. I tried both with and without Liberty Tools and it's the same issue.
It's interesting that it works within IntelliJ with Liberty Tools for IntelliJ IDEA. In any case, this is what needs to be looked into further from the language server's standpoint.
Now, the specification does not make it exact as to where the default config source of META-INF/microprofile-config.properties
should be located except that it's what can be found in class path. We can double check with the spec committers and see if necessary.
@hanczaryk, can you please take another look and retry? I am closing the issue for now. We can reopen if we believe we need to look into it further on the Liberty Tools side still.
A new issue can be filed in the MP language server repository when ready.
I moved to the latest VSCode extension.
I validated that when under resources/META-INF/microprofile-config.properties, the VSCode offers suggestions.
I also confirmed that when under my previous location, webapp/META-INF/microprofile-config.properties, the VSCode does not offer suggestions.
FYI, this SVT application has always had the microprofile-config.properties under webapp and has functioned successfully albeit not using Liberty Tools. I'm not sure about what customer applications in the field may have with regards to file structure but if Liberty tools requires it to be under resources, that should be clearly documented.
I'm unclear as to why this should be filed in the MP Language server repo since a similar action using IntelliJ offers suggestions. In my experience, this seems to be specific to VSCode but I'm not regularly working with the Liberty tools dev team so I would defer to their expertise about where any issues may reside.
Appreciate the update, @hanczaryk! Thanks.
https://github.com/OpenLiberty/liberty-tools-vscode/issues/289 was opened as a duplicate. However, the update in #289 seems to show that even at the resources/META-INF/microprofile-config.properties
location, no suggestions are provided.
FYI, SVT has now started for 23.0.12 and this bug is still a problem using webapp/META-INF/microprofile-config.properties.
When my microprofile-config.properties is located under resources/META-INF/microprofile-config.properties, then I successfully view the suggestions.
I attempted to investigate the trace messages in two scenarios: one where the META-INF/microprofile-config.properties
file was placed under resources
, and the other where it was located under the webapp
directory. In the case where it was under webapp, the response received from 'textDocument/completion' showed empty items. Below is a screenshot for reference.
We should open an issue for the Tools for MicroProfile project for VS Code: https://github.com/redhat-developer/vscode-microprofile and ask for clarification on the expected behaviour for a microprofile-config.properties
file located under the webapp
directory.
Discussion still going on in https://github.com/redhat-developer/vscode-microprofile/issues/182
SVT: No suggestions for microprofile-config.properties in VSCode
I've installed the following level of VSCode on Windows
I installed extension liberty-dev-vscode-ext-0.1.13-SNAPSHOT.vsix for SVT testing.
Looking at the last image in the https://github.com/OpenLiberty/liberty-tools-vscode/blob/main/docs/user-guide.md, I expected to be offered similar suggestions when using Ctrl+Space but instead got no suggestions.
This was an existing SVT application with pre-existing contents in microprofile-config.properties but for this test, I deleted that existing text and was attempting on an empty file.
FYI, I have a similar testing setup using IntelliJ instead of VSCode and this appears to offer suggestions on IntelliJ, so this particular issue seems specific to VSCode.