dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.06k stars 4.04k forks source link

InteliSence character c# not match japanese #35188

Open vsfeedback opened 5 years ago

vsfeedback commented 5 years ago

VSF_TYPE_MARKDOWNWhen Japanese is used for C # variable names and method names, Intellisense only responds with a forward match.

In Visual studio 2013, it worked correctly. This phenomenon occurs in Visual studio 2015 and later, including Visual studio 2019.

``` //It works normally. int EnglishVariable = 0; //Typing "vari" causes Intellisense to display "EnblishVariable".

//It does not work. int 日本語の変数名 = 0; //Typing "変数名" does not show "日本語の変数名" in Intellisense. //Typing "日本語" causes Intellisense to display "日本語の変数名".

```

Image:67017-intellisense-dose-not-work.png

_This issue has been moved from https://developercommunity.visualstudio.com/content/problem/519645/intelisence-character-c-not-match-japanese.html VSTS ticketId: 841021_ _These are the original issue comments:_ Visual Studio Feedback System on 4/8/2019, 01:56 AM (14 days ago):

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

k_matsumoto on 4/10/2019, 00:07 AM (12 days ago):

Sample Code.

//It works normally.
int EnblishVariable = 0;
//Typing "vari" causes Intellisense to display "EnblishVariable".

//It does not work. int 日本語の変数名 = 0; //Typing "変数名" does not show "日本語の変数名" in Intellisense. //Typing "日本語" causes Intellisense to display "日本語の変数名".

Jane Wu [MSFT] on 4/10/2019, 01:12 AM (12 days ago):

Translated from Bing:

Sample Code.

// It works normally.
int EnblishVariable = 0;
// Typing "vari" causes Intellisense to display "EnblishVariable".
// It does not work.
int Japanese variable name = 0;
// Typing "variable name" does not show "Japanese variable name" in Intellisense.
// Typing "Japanese" causes Intellisense to display "Japanese variable name".

These are the original issue solutions: (no solutions)

jinujoseph commented 5 years ago

cc @tmeschter

Youssef1313 commented 3 years ago

For the following:

int EnglishVariable = 0;

IntelliSense only shows the variable if I typed vari or Vari, but not ari:

image

So matching from the middle is done when the letter is an uppercase letter.

Does Japanese have the concept of uppercase letters? If not, this could be "by design".

ufcpp commented 3 years ago

No. All Japanese characters are Letter, Other.

CyrusNajmabadi commented 3 years ago

We would need someone proficient in this space to guide us as to how this would be expected to work, and how that would translate down to the actual code necessary when interrogating these identifiers. @ufcpp Is that something you think you could help us with?

ufcpp commented 3 years ago

Yes, I'm willing to help you.

I found that this issue has already solved in VS 16.10 p1 to some extent.

https://youtu.be/Eg1ykfRAPqE https://youtu.be/iE8wSAtjWTE

IMO, matching from the middle is just enough. Word breaking for Japanese sentence is too difficult.

ufcpp commented 3 years ago

I want matching after _ a little.

image image

ufcpp commented 3 years ago

Ah, one more. I want word breaking between (Ll or Lu) and Lo.

image

FYI, most of letters in Asian scripts are Lo (Letter, Other) category.

One concern is Letter, Modifier... See: https://github.com/icsharpcode/ILSpy/issues/2020