bundabrg / bcf

BCF Command Formatter
https://bundabrg.github.io/bcf/
GNU General Public License v3.0
6 stars 2 forks source link

Subcommand tabcompletions #19

Open Lemar98 opened 2 years ago

Lemar98 commented 2 years ago

Why is it not possible to add tabcompletions to a subcommand?

bundabrg commented 2 years ago

It should tab complete on the sub commands as well. Do you have a simplified example?

Lemar98 commented 2 years ago

Most likely you did not understand me because of my bad English, sorry.

Let's say I have /macommand sub

I want to display a list of tabcompletions to the player when he types /maincommand sub so he has a hint for arg1, arg2 and arg3

Is it possible with your api to provide the player with options for arguments in the form of tabcompletions ?

bundabrg commented 2 years ago

Actually that's exactly what it should do. When you type /maincommand sub and hit space then it should then show a list of the options you can choose from. I'll double check that I didn't break anything in one of my recent changes that affect sub command completion.

Lemar98 commented 2 years ago

I want to pass my own list of hints as tab completions, for example, taken from the config

Lemar98 commented 2 years ago

are you here?

bundabrg commented 2 years ago

Regarding this issue. It may be that you need to write a custom parser (which is pretty easy). For example in my plugin PortalNetwork it has definitions of portal types in a config file. I then have a custom parser registered with the string @parsertype that when dropped into @Arg will load the config and show completions based on their names, with descriptions as their tooltips.

Here's a screenshot of the parser (since it's not committed yet) and I'll make sure to write some docs on how to create the parsers.

image