microsoft / microsoft/monaco-editor

Chinese IME does not work correctly with CompletionItemProvider

Open
#2,199 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug editor-input-IME help wanted suggest
Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

If set suggestion label as a chinese text, the auto complete item will never show when input with chinese IME like sougou.

And I found that the suggestion check is triggered in 'compositionupdate' event instead of 'compositionend,' then the selection check is failed, the preSelection(typed alpha text) is after currentSelection(chinese text):

//  in suggestModel.js : _onCursorChange

(!prevSelection.containsRange(this._currentSelection) && !prevSelection.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))

In vscode there is same problem. the snippets with chinese label doesn't not work.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in suggestModel.js at _onCursorChange and trace how compositionupdate and compositionend affect the selection checks. Reproduce the issue with a Chinese IME and a Chinese suggestion label; done means completion items and snippets with Chinese labels appear correctly during IME input.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.