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

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

Open
hanczaryk opened this issue May 16, 2023 · 10 comments
Open

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

hanczaryk opened this issue May 16, 2023 · 10 comments
Labels
bug Something isn't working language client language server integration should-fix SVT

Comments

@hanczaryk
Copy link
Member

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
Copy link
Member

yeekangc commented May 19, 2023

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
Copy link
Member

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

@github-project-automation github-project-automation bot moved this from Should Fix to ✅ Done in Liberty Tools Release Plan May 19, 2023
@yeekangc
Copy link
Member

yeekangc commented May 19, 2023

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

@hanczaryk
Copy link
Member Author

hanczaryk commented May 23, 2023

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.

@hanczaryk hanczaryk reopened this May 23, 2023
@yeekangc
Copy link
Member

Appreciate the update, @hanczaryk! Thanks.

@cherylking cherylking moved this from ✅ Done to Should Fix in Liberty Tools Release Plan May 31, 2023
@TrevCraw TrevCraw added the language client language server integration label Jul 24, 2023
@TrevCraw TrevCraw moved this from Should Fix to Fix Later in Liberty Tools Release Plan Jul 27, 2023
@TrevCraw
Copy link
Contributor

#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
Copy link
Member Author

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
Copy link
Contributor

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
Copy link
Contributor

TrevCraw commented Feb 21, 2024

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
Copy link
Contributor

Discussion still going on in redhat-developer/vscode-microprofile#182

@TrevCraw TrevCraw added this to the 24.0.11 milestone Oct 27, 2024
@TrevCraw TrevCraw removed this from the 24.0.11 milestone Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working language client language server integration should-fix SVT
Projects
Development

No branches or pull requests

5 participants