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

中文 和中文之间插入无法触发补全。 #49

Open
cxwx opened this issue Feb 9, 2025 · 6 comments
Open

中文 和中文之间插入无法触发补全。 #49

cxwx opened this issue Feb 9, 2025 · 6 comments

Comments

@cxwx
Copy link

cxwx commented Feb 9, 2025

Image Image

中文开头,结尾都可以补全,唯独中间无法补全。

也许是LSP trigger 的问题,如何配置

@wlh320
Copy link
Owner

wlh320 commented Feb 9, 2025

nvim 版本?LSP 的编码?0.10.2 以后 + UTF-16 大概率是 #38 这个问题。

现在应该不论 rime-ls 的 trigger 设置成什么在中文之后都能补全。

不是这个问题的话可能我要找时间查一下。

@cxwx
Copy link
Author

cxwx commented Feb 11, 2025

nvim: bob install 0.10.4
macOS Sequoia 15.3

@cxwx
Copy link
Author

cxwx commented Feb 11, 2025

nvim 版本?LSP 的编码?0.10.2 以后 + UTF-16 大概率是 #38 这个问题。

现在应该不论 rime-ls 的 trigger 设置成什么在中文之后都能补全。

不是这个问题的话可能我要找时间查一下。

还真是这个问题,
但是配置 capabilities3.general.positionEncodings = { "utf-8" } 之后 每次都会出 warning

   Warn  19:17:27 notify.warn warning: multiple different client offset_encodings detected for buffer, this is not supported yet

咋删掉这个报警,

@wlh320
Copy link
Owner

wlh320 commented Feb 11, 2025

还需要在 lspconfig setup 的时候加上 offset_encoding = "utf-8",虽然不知道为什么但加上确实没 warning 了,但是要小心有些 lsp server 可能不支持 utf-8。

可以参考我的配置 https://github.com/wlh320/wlh-dotfiles/blob/85d41a30588642617177374b4cea2ec96c1b2740/config/nvim/init.lua#L457

目前没什么更好的解决方法了,除非用 nightly 或者等 0.11 出来就不需要 utf-8 也可以正常用了

@twio142
Copy link

twio142 commented Feb 14, 2025

请问 capabilities.general.positionEncodingsoffset_encoding 这两项是要为所有的 lsp 都配置吗?还是只需要为 rime_ls 配置?

@wlh320
Copy link
Owner

wlh320 commented Feb 15, 2025

请问 capabilities.general.positionEncodingsoffset_encoding 这两项是要为所有的 lsp 都配置吗?还是只需要为 rime_ls 配置?

只为 rime-ls 配可以解决这个 bug,但是 lspconfig 会报 warning,能接受就可以只配 rime-ls,想要没 warning 就全都配置,这样不支持 utf-8 的 lsp 会不能用,但这种情况应该比较少,所以我建议全配一下试试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants