microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.23k stars 29.29k forks source link

Cannot highlight U+200B and unhighlight multiple languages at the same time #176273

Open freshchild opened 1 year ago

freshchild commented 1 year ago

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Input U+200B​ and some unicode characters with multiple languages.
U+200B->​<-U+200B

- test
- 测试
- テスト
- тест
  1. If both .invisibleCharacters and .nonBasicASCII are true, then

image

  1. However, if .invisibleCharacters is true, and .nonBasicASCII is false, then

image

.code-workspace:

{
    "folders": [
        {
            "path": ".\\",
            "name": "Test"
        }
    ],
    "settings": {
        "editor.unicodeHighlight.includeStrings": true,
        "editor.unicodeHighlight.invisibleCharacters": true,
        "editor.unicodeHighlight.nonBasicASCII": true,
        "editor.unicodeHighlight.allowedLocales": {
            "_os": true,
            "_vscode": true,
            "zh_cn": true,
            "ja": true,
            "ja-jp": true,
            "ru": true,
            "ru-ru": true,
        },
        "editor.unicodeHighlight.ambiguousCharacters": false,
        "editor.unicodeHighlight.includeComments": true,
    }
}

It seems that there is no document related to editor.unicodeHighlight.allowedLocales standard input, so it is written according to the Visual Studio Code Language ID, If there is anything wrong, please correct it.

hediet commented 1 year ago

I cannot reproduce Code_-_Insiders_qVbubiML54

freshchild commented 1 year ago

I cannot reproduce Code_-_Insiders_qVbubiML54

Sorry, after retesting in 1.77.3, it seems to be reproduced only on .md:

I disabled all extensions in this workspace, so it should be caused by the editor.

freshchild commented 1 year ago

BTW, highlighting doesn't seem to work when U+200B is surrounded by specific characters, like:

image

Maybe it should be on another issue, just so you know.