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

Vendor codespan, and fix character offset issues #1793

Merged
merged 1 commit into from
Jan 30, 2024
Merged

Conversation

jneem
Copy link
Member

@jneem jneem commented Jan 30, 2024

The original motivation here was that I wanted to update lsp_types but was blocked by codespan_lsp's dependency on an old version. codespan_lsp seems to be abandoned (along with the rest of codespan). Since it's only a few utility functions, the easiest thing was to vendor it.

While I was doing that, I noticed that we aren't correctly converting byte positions to lsp positions in some of our responses, so I fixed that.

@jneem jneem requested review from vkleen and yannham January 30, 2024 15:09
@github-actions github-actions bot temporarily deployed to pull request January 30, 2024 15:14 Inactive
Copy link
Member

@yannham yannham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While vendoring isn't ideal, it doesn't seem easy to upstream that (at first I thought we could try to contact codespan_lsp's maintainer and take over but this is part of a codespan mono-repo, which makes it harder), and it's of reasonable size.

foo = "𐑄𐐮𐑅 𐐰𐑊𐑁𐐰𐐺𐐯𐐻 𐐮𐑆 𐐿𐐭𐑊", bar = 1
}.bar
### # The "bar" in the first line is at lsp "character" 45--48,
### # because lsp measures characters in UTF-16 codepoints 🤦
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but is 🤦 an UTF-16 codepoint? Asking important questions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's two of them, apparently...

@jneem jneem added this pull request to the merge queue Jan 30, 2024
Merged via the queue into master with commit 4914f5b Jan 30, 2024
5 checks passed
@jneem jneem deleted the codespan-lsp branch January 30, 2024 18:29
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

Successfully merging this pull request may close these issues.

2 participants