voldikss / coc-browser

See https://github.com/voldikss/coc-extensions
127 stars 6 forks source link

Support non-English characters #10

Closed kantord closed 3 years ago

kantord commented 3 years ago

fix #9

kantord commented 3 years ago

I'm not sure how to test it, so I haven't tested it in the browser, but I've tested the regexp itself.

2021-01-09T11:33+01:00

kantord commented 3 years ago

Also not sure if it could be somehow extended to languages that don't need to put non-word characters between words

voldikss commented 3 years ago

Hi @kantord thanks for this but I feel that this would make it more disturbing for completion.

Because I am a chinese, the regex in the patch will grab all the chinese characters, which are not what we want.

image

kantord commented 3 years ago

What would be the expected behavior for Chinese text?

voldikss commented 3 years ago

Chinese text should not be grabbed as it is too disturbing

voldikss commented 3 years ago

Actually East Asian people like me usually doesn't use completion from their native language text.

kantord commented 3 years ago

So to understand better: your ideal use case is grabbing completion only from source code? Or is it: only source code + text in foreign languages?

If it's more about code then perhaps it's possible to only enable completion from the <code /> html tag.

Or perhaps also stuff like code review threads on GitHub/GitLab

voldikss commented 3 years ago

So to understand better: your ideal use case is grabbing completion only from source code?

No matter whether from souce code. What I originally want is to grab English words for completion. The language words in your screenshot is also acceptable, but your regular expression doesn't filter out east-asian characters.

kantord commented 3 years ago

Technically it's possible to filter out only certain scripts. For example the Unicode property Latn will only include characters from the Latin script, what do you think?

TBH it's not a big deal for me either, as my main use case is autocompletion from pull requests and other English text, I just noticed by accident that certain characters are not supported

voldikss commented 3 years ago

I feel that this is useful sometime but maybe English words completion is sufficient. I tend to not include this feature, what's your thoughts?

kantord commented 3 years ago

yup, that makes sense