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

Completion does not replace text typed by user #276

Closed
turkeylurkey opened this issue May 1, 2024 · 6 comments · Fixed by #306
Closed

Completion does not replace text typed by user #276

turkeylurkey opened this issue May 1, 2024 · 6 comments · Fixed by #306
Assignees
Labels
bug Something isn't working low priority

Comments

@turkeylurkey
Copy link
Member

When editing bootstrap.properties in some cases completion replaces all of the text I type but in others it leaves some text behind and creates an invalid key. Tested using VS Code and Liberty Tools version v24.0.3.

The correct result: type "com.ibm.ws.log" and select the first result and the key "com.ibm.ws.logging.apps.write.json" is added.
image
image

Then erase part of the key so that only "com.ibm.ws.log" is showing and select the first result. "com.ibm.ws.com.ibm.ws.logging.apps.write.json" is added.
image
image

This seems like a bug.

@cherylking
Copy link
Member

Interesting, I would like to know if the same behavior is seen in Eclipse. I'm wondering if the problem could be with the data sent from VS Code to LCLS in the second request.

@scottkurz
Copy link
Member

scottkurz commented May 2, 2024

It looks like it works fine on Eclipse with 24.0.3 (actually an internal build of our next release). I deleted my recording but will try to post a new one at some point.

@cherylking
Copy link
Member

Thanks Scott. So if it works in Eclipse, I think it is unlikely that it is a problem in LCLS. However, the fix may still be in LCLS to accommodate for whatever data is coming from VS Code that leads to the problem. We will have to compare the data that is coming in on the two requests and see what is different. I will mark this as a bug. It will be a low priority though.

@TrevCraw
Copy link
Contributor

TrevCraw commented May 2, 2024

This issue came up when working on integrating the latest LSP4IJ for LT IntelliJ. VS Code was tried as a comparison: redhat-developer/lsp4ij#270 (comment)

@cherylking
Copy link
Member

cherylking commented May 2, 2024

We use the constructor for CompletionItem that takes a String, which is our property key and gets set as the label in CompletionItem. The suggestion in the referenced issue by Trevor is to use TextEdit instead of passing the property key as the label. There is a method setTextEdit on CompletionItem. Will have to investigate using that instead of the label for the key.

@angelozerr
Copy link
Contributor

This issue should be fixed with LSP4IJ 0.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low priority
Projects
None yet
6 participants