Microsoft/monaco-editor

Import suggestions are not displayed when the caret is positioned after the last character

Open

#2,682 opened on Oct 5, 2021

View on GitHub
 (1 comment) (0 reactions) (0 assignees)JavaScript (1,283 forks)batch import
bughelp wantedtypescript

Repository metrics

Stars
 (14,836 stars)
PR merge metrics
 (Avg merge 6h 26m) (15 merged PRs in 30d)

Description

Monaco can provide a pretty nice import suggestions as following:

But it only works when the caret position is positioned before the last character or even further back. However, it does not work if the caret is positioned after the last character, which is the most intuitive place where usually import suggestions are requested, because as a developer I type out the function I'd like to import, and then I'd like to press CTRL+. to pop the suggestions, but right now I have to move the caret back at least 1 position before I can pop the suggestions, which a lot of people can miss this feature in the first place.

When I try to pop for suggestions after the last character I get the following:

Contributor guide