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

Hover informations seems offset by non-ascii characters #1355

Closed
1 task done
frabr opened this issue Feb 3, 2024 · 2 comments
Closed
1 task done

Hover informations seems offset by non-ascii characters #1355

frabr opened this issue Feb 3, 2024 · 2 comments
Labels
bug Something isn't working pinned This issue or pull request is pinned and won't be marked as stale

Comments

@frabr
Copy link

frabr commented Feb 3, 2024

Operating System

fedora 39

Ruby version

3.1

Project has a bundle

  • Has bundle

Ruby version manager being used

rbenv

Description

Hi,
Thank you for your amazing work !
I noticed a strange behavior while using ruby-lsp extension in visual studio code. It seems that non-ascii characters are offsetting hovers to the right/bottom. Would it have something to do with counting charaters bytewise vs scalar (utf-8) ?
This piece of code should be sufficient for reproduction :

  array = []
  # éééééééééééééééééééééé
  puts "çççççççççççççççççççççç"
  array.each
  
  # each hover def will be around-->here<--

Maybe I'm doing something wrong with my setup but I couldn't find anywhere to define encoding or stuff like that.

@frabr frabr added the bug Something isn't working label Feb 3, 2024
@vinistock
Copy link
Member

Hey! Thank you for the kind words.

I suspect this is related to #1251. The Prism parser returns locations based on bytes instead of characters and we need to better account for that.

This is specific to the Ruby LSP server, so I'm transferring the issue there.

@vinistock vinistock transferred this issue from Shopify/vscode-ruby-lsp Feb 5, 2024
@vinistock vinistock added the pinned This issue or pull request is pinned and won't be marked as stale label Feb 5, 2024
@vinistock
Copy link
Member

Since this issue is a duplicate of #1251, I'm going to close this issue to centralize all discussions there. PR #2619 is about to fix this.

@vinistock vinistock closed this as not planned Won't fix, can't repro, duplicate, stale Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pinned This issue or pull request is pinned and won't be marked as stale
Projects
None yet
Development

No branches or pull requests

2 participants