lxtk-org / lxtk

Language Client/Server Toolkit
Eclipse Public License 2.0
33 stars 2 forks source link

LXTK throws illegal state exception if there is only one exit position in snippet #21

Closed xcariba closed 4 years ago

xcariba commented 4 years ago

Snippet text example:

MyMethod($0)

When you apply this snippet it throws exception

java.lang.IllegalStateException: must specify at least one linked position
    at org.eclipse.jface.text.link.LinkedModeModel.enforceNotEmpty(LinkedModeModel.java:530)
    at org.eclipse.jface.text.link.LinkedModeModel.install(LinkedModeModel.java:484)
    at org.eclipse.jface.text.link.LinkedModeModel.forceInstall(LinkedModeModel.java:441)
    at org.lxtk.lx4e.ui.completion.LSIncompleteCompletionProposal.apply(Unknown Source)
    at org.lxtk.lx4e.ui.completion.LSCompletionProposal.apply(LSCompletionProposal.java:88)
pisv commented 4 years ago

Thanks for catching that! This bug was introduced when trying to fix #18. I'll try to review the PR today.

pisv commented 4 years ago

Fixed in master. Please verify.

xcariba commented 4 years ago

Checked your fix, works for me, thanks!

pisv commented 4 years ago

Thank you!