From cc57b4b44f1b792280231acf8c68798df906c095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= Date: Sun, 17 Dec 2023 21:17:19 +0100 Subject: [PATCH] explain how to produce suggestions --- docs/core/index.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/core/index.md b/docs/core/index.md index 4713924..900a0a5 100644 --- a/docs/core/index.md +++ b/docs/core/index.md @@ -534,6 +534,14 @@ The parser may implement the `suggestions` method to produce suggestions. These suggestions will be used to provide suggestions for the component using the parser, unless the component is created using a custom suggestion provider. +Parsers implement `SuggestionProviderHolder` which means that they can return a suggestion provider by overriding +the `suggestionProvider` method. +However, the recommended way of providing suggestions is by implementing one of the suggestion provider +interfaces (`SuggestionProvider`, `SuggestionProvider.Strings`, +`BlockingSuggestionProvider` or `BlockingSuggestionProvider.Strings`). +If the parser implements a suggestion provider interface it does not need to override the `suggestionProvider` +method, as it'll return `this` by default. + ## Extra ### Confirmations