Quicks - A Smart Snippet Coding Tool

Update 0.4.4

More Autocomplete Power!!

image
Arguments themselves can now have autocomplete, and you too can add this to your own quicks!

How? Add autocompleteArgs to your quick, and return an array of Response’s (Scroll down a bit to see the type) OR if you just want to return the basic autocomplete use the function that you can pass in as many strings as you want and it will convert it into the correct format. Simply return Utils.createBasicAutocompletes(…) just as seen below.

This also allows for more powerful completions with access to the whole document object, and the index of the argument that is currently being edited(Starting at 1) This lets you have different suggestions for the first and second argument and so on.

Also dont worry about narrowing the autocompletes down, this will automatically be done internally.

editingArgIndex - The index of the arg that is being currently edited
arguments - an array of all arguments given so far. arguments[editingArgIndex] returns the current argument thats being edited
Being edited means the text cursor is there.
An example would be >TEST(aa,bb|);
If | is where the cursor is at then editingArgIndex is 2, and arguments[editingArgIndex] is bb

A fancier autocomplete


Lots more is going on here

More info below where each new util is explained. Feel free to comment if something doesn’t make sense.

I may show some more complex examples of this in this thread some time.
Not every built in command has or needs argument autocomplete.

What else changed?

  • Some Bug Fixes

  • A big internal code rework since this project is getting big, and needs to stay maintainable.

  • Fixed some issues where autocompletes would have \n in them

  • Added some Utils

    • FindCharInString(str, charPattern) - returns a table containing { index, line, lineIndex }
    • GetCharacterAtPosition(str, lineNum, charNum) - Returns a character in a string. Think of charNum as X, and lineNum as Y. Gets the character at a certain line number with charNum characters in
    • CombineKeyTables(table1, table2) - Combines any 2 key-based tables
    • CombineKeyTables(…) - pass any amount of strings in and it will return an array of Responses
    • createBasicAutocompletesWithDefaultValues({}, …) - Just like createBasicAutocompletes, but instead but the first argument is a “Response template” that will be applied to every other Response on the list. See example above
  • A few other minor tweaks

The autocomplete can also be used as a live preview of what its going to turn into as demoed in the new >GS()

Please give me feedback, suggestions, and even share with me what you use this for as it helps me figure out what people like, what people need, as well as motivation.

1 Like

I quite enjoy this plugin, I know this is quite old however I still thought I’d point out 2 bugs.

  1. MessagingService missing from autocomplete
  2. TeleportService is mispelled as “Teleport Service” in the autocomplete

nothing big, but its nice to bump this plugin anyways because i do use it frequently.

2 Likes

Thanks for telling me! I will take a look when I can, also I thought nobody used this plugin so its nice to hear that someone uses it. Maybe ill make additions to it again someday, but ill fix those since it shouldn’t be too hard to do. Also nice to see bug reports instead of people saying nothing. Ill reply again when that gets done, also thanks for the bump!

Also if you have any more feedback id love to hear it!

1 Like

Both of these should be fixed now, thanks for using the plugin! Feel free to share any work or custom quicks :slight_smile:

Thanks for reporting the bugs!

1 Like