Revxrsal / Lamp

A modern annotations-driven commands framework for Java and Kotlin
MIT License
202 stars 38 forks source link

[Enhancement] Kotlin Extensions for AutoCompleter #11

Closed TehNeon closed 2 years ago

TehNeon commented 2 years ago

There are currently no extensions or additional functions for the AutoCompleter system. This currently results in having to write some pretty ugly looking code.

What the code looks like in Kotlin currently:

commandHandler.autoCompleter.registerParameterSuggestions(String::class.java) { args, sender, command ->
    emptyList<String>()
}

What it could look like in Kotlin (This example follows the current naming scheme of the extensions):

commandHandler.autoCompleter.parameterSuggestions<String> { args, sender, command ->
    emptyList<String>()
}
Revxrsal commented 2 years ago

Yes, auto-completer extensions should be implemented. Will get to this soon :)

Revxrsal commented 2 years ago

Added in https://github.com/Revxrsal/Lamp/commit/6eee6ccd6eca864b6d318d5f014f20cd465104ac.