[Feature Request] Can we have a predicate to decide if a completion popup should be displayed? #4497
Open
2 tasks done
Labels
feature-request
Request for new features or functionality
Context
Description
When we develop our own code completion implementing the
CompletionItemProvider
interface we are bound to a set of trigger characters that make the popup to be shown. This in some cases is not really convenient as the popup shows in the wrong context. For example I'm interested in displaying autocompletion in case of identifier usage and not to show it when declaring one. While searching the internet I was able to find some "dirty" suggestions like sending events. See #1764.Anyway, can we have a predicate function instead or in addition to the
triggerCharacters
array? It could look like this:Then we can have an access to
model
to do some parsing and make a decision based on last token. We have acontext
to find out which event triggered the function and we know a cursorposition
. Probably, a delay to call this predicate should be set in the editor configuration, so it won't be called too often.Monaco Editor Playground Link
No response
Monaco Editor Playground Code
No response
The text was updated successfully, but these errors were encountered: