prisma / language-tools

🌐 Prisma Language Tools = Language Server and Prisma's VS Code extension.
https://marketplace.visualstudio.com/items?itemName=Prisma.prisma
Apache License 2.0
257 stars 40 forks source link

Language server cannot correctly report diagnostics for sources containing multibyte characters #1721

Closed kyoh86 closed 4 months ago

kyoh86 commented 6 months ago

Bug description

If a source contains multi-byte characters, Prisma Language Server cannot report diagnostics with correct position.

e.g.

// 📅📅📅📅📅
enum Day {
  Monday
  Tuesday
  Wednesday
  Thursday,
  Friday
  Saturday
  Sunday
}

It must be reported that a problem is in the line Thursday, that is not an enum value definition. But the problem is reported in a position of Friday.

While you put a charater 📅 more, the reported position also shift.

How to reproduce

Expected behavior

The problem is reported in correct position.

Prisma information

// 📅📅📅📅📅
enum Day {
  Monday
  Tuesday
  Wednesday
  Thursday,
  Friday
  Saturday
  Sunday
}

Environment & setup

iamel89 commented 5 months ago

Same issue: https://github.com/prisma/language-tools/issues/1308

Druue commented 4 months ago

Hey @kyoh86, a PR fixing issues with multibyte characters was part of our 5.16.0 release, can you please confirm if that version resolves this issue for you?

Thank you in advance! 🙏

kyoh86 commented 4 months ago

@Druue Wow! It's fixed! Thanks so much!

Druue commented 4 months ago

Cool, I'll be closing this as complete then :) ✨