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

Improved logging and error checking in LibertyPropertiesHoverProvider #295

Closed
turkeylurkey opened this issue Aug 15, 2024 · 1 comment · Fixed by #305
Closed

Improved logging and error checking in LibertyPropertiesHoverProvider #295

turkeylurkey opened this issue Aug 15, 2024 · 1 comment · Fixed by #305
Assignees
Labels
bug Something isn't working LCLS Liberty Config Language Server

Comments

@turkeylurkey
Copy link
Member

I found the following stack trace in the log while using this language server. The problem is that the document object in a LibertyPropertiesHoverProvider object is null and it is used later.

Caused by: java.lang.NullPointerException: Cannot invoke "io.openliberty.tools.langserver.ls.LibertyTextDocument.getUri()" because "tdi" is null
	at io.openliberty.tools.langserver.LibertyConfigFileManager.isServerEnvFile(LibertyConfigFileManager.java:103)
	at io.openliberty.tools.langserver.LibertyConfigFileManager.isConfigFile(LibertyConfigFileManager.java:148)
	at io.openliberty.tools.langserver.hover.LibertyPropertiesHoverProvider.getHover(LibertyPropertiesHoverProvider.java:31)
	at io.openliberty.tools.langserver.LibertyTextDocumentService.hover(LibertyTextDocumentService.java:121)

I would like to see the constructor for LibertyPropertiesHoverProvider check that the input parameter is not null and if it is generate a stack trace so we can investigate the problem when it first happens.

@turkeylurkey turkeylurkey added bug Something isn't working LCLS Liberty Config Language Server labels Aug 15, 2024
@arunvenmany-ibm arunvenmany-ibm self-assigned this Sep 30, 2024
@arunvenmany-ibm
Copy link
Contributor

arunvenmany-ibm commented Sep 30, 2024

@turkeylurkey
Please review the changes in liberty-ls/src/main/java/io/openliberty/tools/langserver/LibertyTextDocumentService.java in PR :- https://github.com/OpenLiberty/liberty-language-server/pull/305/files
We have put some error messages.. Please confirm whether this matches your requirement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working LCLS Liberty Config Language Server
Projects
None yet
2 participants