biomejs / biome-intellij

Biome plugin for IntelliJ
https://plugins.jetbrains.com/plugin/22761-biome
Apache License 2.0
60 stars 15 forks source link

Bug when pasting emojis into IntelliJ #76

Open JamyGolden opened 3 months ago

JamyGolden commented 3 months ago

Problem

There is an issue where IntelliJ Biome formats emojis when they are pasted into the document.

  1. Have Biome installed and Run format on save enabled.
  2. Paste in ✈️ (unicode value: U+2708 U+FE0F) into the document

It formats that emoji to ✈ (unicode value: U+2708) when pasting in it - not even on save. Biome cli itself doesn't do this formatting, so it's definitely an IntelliJ Biome issue. When Run format on save is not enabled, I don't get the error.

Expectation

When pasting the emoji into the document, it doesn't format away the U+FE0F emoji bit of the unicode character, like IntelliJ behaves without Biome IntelliJ Run format on save option enabled.

System information

Operating System: PopOs 22.04 and MacOS Sonoma App: IntellJ IDEA Ultimate 2024.2.0.1 Biome IntelliJ version: 1.2.1 and also tried 1.0.0

nhedger commented 3 months ago

Can you confirm this happens even if the biome extension is disabled?

JamyGolden commented 3 months ago

If the Biome extension is disabled, the expected functionality happens: Pasting the emoji (unicode value: U+2708 U+FE0F) is correctly pasted as is into the file and the U+FE0F part is not stripped away.

A colleague of mine actually ran into this issue and I was able to recreate it so I know this at least happens on different operating systems and different machines.

henrik242 commented 3 months ago

Just popping by to say I can still reproduce this on Biome 1.4.0 in Intellij IDEA 2024.2.1

cstuncsik commented 2 months ago

It happens to me as well, Biome 1.4.0 in Intellij IDEA 2024.2.1 on MacOS Sonoma 14.7

Pasting this emoji (⚠️) into my translation json file works but when I save the file it gets replaced to ! but the others are untouched

{
  "warning": "⚠️ Warning",
  "welcome": "👋 Welcome {name}!",
  "askAi": "✨ Ask AI",
  "seeThis": "👈 This is {node}’s AI Logs"
}

It works at the playground though

Maybe it's an IntelliJ problem not Biome

henrik242 commented 1 month ago

More detailed steps to reproduce: 1) Use Biome plugin 1.4.0 in IntelliJ IDEA 2024.2.3 (using Biome 1.9.1) with Format on Save enabled

2) Open this file: test1.json

Skjermbilde 2024-10-28 kl  09 35 36

3) Make a small change and save it

4) The emoji will have changed like this: test2.json

Skjermbilde 2024-10-28 kl  09 35 48