-
Notifications
You must be signed in to change notification settings - Fork 305
A problem for editing Non-ASCII characters #282
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
Comments
Thanks for your report about this. Could you please try #284 ? |
Thanks your confirm. I have to make another benchmark case. Current code use small string. It should use long string too. |
I see, that should be done. If there are anything I can do, let me know. I wish if this proposal submitted to official LSP was accepted ... |
Sorry, my inspection was insufficient, and it seems to need some more process for the 2 code units characters. Adding such characters is now OK on I compare the ts-server logs, for the '𐐀' removal on the example of this issue, which comes from vim(-lsp) and VisualStudioCode, and found that the position calculation for removing the 2 code units characters should also be aware the size of code units. I mean, even though Here is the logs of ts-server: vim(-lsp):
VSC:
(the values of I'm not sure, but it seems hard to detect the length of the removed character's code units (from the both point of implementation and efficiency). |
Fixed by #447 |
Hi,
When I edit a file which includes Non-ASCII characters as the comments, string literals, ..etc., vim-lsp goes wrong.
For example:
When I remove
𐐀
(assigning a empty string toE.S
) in the code above,Unterminated literal string
error is shown on that line (the lineS
is defined).E
does not work.After some investigation, what I've got is:
character
in the parameter to the server should be counted on a UTF-16 string representation (LSP SPEC).strlen()
is used in vim-lsp for the calculation.=> vim-lsp sends the wrong
character
parameter to the server when the non-ascii characters (whose code point is more than 0x10000) are edited.A solution for this problem is, I think, replacing
strlen()
with the function like below:I'm not good at Vim script, so I hope these information helps fixing the problem.
The text was updated successfully, but these errors were encountered: