OpenLiberty / liberty-tools-vscode

Visual Studio Code extension for Liberty Tools
https://marketplace.visualstudio.com/items?itemName=Open-Liberty.liberty-dev-vscode-ext
Eclipse Public License 2.0
16 stars 29 forks source link

SVT: No suggestions for microprofile-config.properties in VSCode #249

Open hanczaryk opened 1 year ago

hanczaryk commented 1 year ago

SVT: No suggestions for microprofile-config.properties in VSCode

I've installed the following level of VSCode on Windows

Version: 1.78.0
Commit: 252e5463d60e63238250799aef7375787f68b4ee
Date: 2023-05-03T20:09:00.748Z
Electron: 22.4.8
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.19045
Sandboxed: Yes

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.

image

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.

yeekangc commented 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.

yeekangc commented 1 year ago

@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.

yeekangc commented 1 year ago

A new issue can be filed in the MP language server repository when ready.

hanczaryk commented 1 year ago

I moved to the latest VSCode extension.

I validated that when under resources/META-INF/microprofile-config.properties, the VSCode offers suggestions. image

I also confirmed that when under my previous location, webapp/META-INF/microprofile-config.properties, the VSCode does not offer suggestions. image

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.

yeekangc commented 1 year ago

Appreciate the update, @hanczaryk! Thanks.

TrevCraw commented 9 months ago

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.

hanczaryk commented 8 months ago

FYI, SVT has now started for 23.0.12 and this bug is still a problem using webapp/META-INF/microprofile-config.properties. image

When my microprofile-config.properties is located under resources/META-INF/microprofile-config.properties, then I successfully view the suggestions. image

anusreelakshmi934 commented 4 months ago

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.

image
TrevCraw commented 4 months ago

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.

anusreelakshmi934 commented 2 months ago

Discussion still going on in https://github.com/redhat-developer/vscode-microprofile/issues/182