Closed tigersoldier closed 5 years ago
@yyoncho Please try this out. Your PR was reverted because it breaks filtering.
BTW, I copied your commit description about emacs-lsp/lsp-java#95, but I think the issue it fixes is emacs-lsp/lsp-java#67. It's unclear to me how your PR was fixing emacs-lsp/lsp-java#95.
It works fine.
emacs-lsp/lsp-java#95 is typo, the proper issue is https://github.com/emacs-lsp/lsp-java/issues/46 .
When expanding snippets, company-lsp calls
yas-expand-snippet
which replaces text within given range with the insert text. Currently, the start of the range is set to the start of the prefix. However, in some cases the start of text edit range can be different from the start of the prefix. For example in lsp-java (JDTLS), when completingjava.util
, the start of prefix is beforeutil
. However the candidate can bejava.util.List
, whose start of range is beforejava
. Because currently we are using the prefix start,java.util
will becomejava.java.util.List
, which is caused by replacingutil
withjava.util.List
.This change should fix emacs-lsp/lsp-java#95 and emacs-lsp/lsp-java#46