Skip to content

Implement utf-8 offsets extension from clangd #7453

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

Closed
matklad opened this issue Jan 26, 2021 · 5 comments · Fixed by #7657
Closed

Implement utf-8 offsets extension from clangd #7453

matklad opened this issue Jan 26, 2021 · 5 comments · Fixed by #7657
Labels
S-actionable Someone could pick this issue up and work on it right now

Comments

@matklad
Copy link
Member

matklad commented Jan 26, 2021

https://clangd.llvm.org/extensions.html#utf-8-offsets

we should totally support this.

@lnicola lnicola added the S-actionable Someone could pick this issue up and work on it right now label Jan 26, 2021
@matklad
Copy link
Member Author

matklad commented Jan 26, 2021

@bkchr would you be willing to submit a patch for this?

I thing you need to:

  • rename LineCol and associated methods to LineColUtf16
  • add LineCol (uft8 version) to the LineIndex
  • Add utf8_offsets: bool capability in the config.rs
  • change to_proto/from_proto modules to respect it.

@bkchr
Copy link
Contributor

bkchr commented Jan 26, 2021

Yeah, I will try to find some time for it :)

Actually doing it in Rust should be way faster than doing it in lisp :D

@kjeremy
Copy link
Contributor

kjeremy commented Jan 26, 2021

@flodiebold flodiebold changed the title Implement uft-8 offsets extension from clangd Implement utf-8 offsets extension from clangd Jan 26, 2021
@matklad
Copy link
Member Author

matklad commented Feb 5, 2021

@bkchr did you get the chance to look into this? If not, I might look into this this weekend (but no promises :D )

@bkchr
Copy link
Contributor

bkchr commented Feb 5, 2021

@matklad Not yet :( Do you have seen this emacs-lsp/lsp-mode#2080 (comment) ?

@matklad matklad mentioned this issue Feb 12, 2021
bors bot added a commit that referenced this issue Feb 16, 2021
7657: utf8 r=matklad a=matklad

- Prepare for utf-8 offsets
- reduce code duplication in tests
- Make utf8 default, implement utf16 in terms of it
- Make it easy to add additional context for offset conversion
- Implement utf8 offsets

closes #7453

Co-authored-by: Aleksey Kladov <[email protected]>
bors bot added a commit that referenced this issue Feb 16, 2021
7657: utf8 r=matklad a=matklad

- Prepare for utf-8 offsets
- reduce code duplication in tests
- Make utf8 default, implement utf16 in terms of it
- Make it easy to add additional context for offset conversion
- Implement utf8 offsets

closes #7453

Co-authored-by: Aleksey Kladov <[email protected]>
@bors bors bot closed this as completed in c9672a0 Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants