Skip to content

Instantly share code, notes, and snippets.

@tooolbox
Last active September 14, 2020 17:31
Show Gist options
  • Save tooolbox/5cafd0d07de711b3d554d7b0087760e1 to your computer and use it in GitHub Desktop.
Save tooolbox/5cafd0d07de711b3d554d7b0087760e1 to your computer and use it in GitHub Desktop.
List of feature requests or bug reports for Chime

Moved into comments

...To support emoji and screenshots.

@tooolbox
Copy link
Author

tooolbox commented Jun 16, 2020

A completion placeholder is itself not all that useful for anything except typing. Some ideas:

  • You can't trigger auto-complete (Ctrl+Space) when you're highlighting a placeholder; you should be able to, and it should filter by what can fit in that location! Xcode allows you to start auto-completion with Ctrl+Space but don't seem to filter the list by what's applicable to that spot.
  • Hitting Enter while you're on a placeholder should insert some text, put your cursor at the end of the text, and...possibly start autocomplete. I'll cover some rules for that below.
  • Hitting Backspace while you're on a placeholder should delete the placeholder and automatically prompt autocomplete, obviously showing what options are applicable for that spot.

Placeholders

  • For a function, the placeholders are the variable names. i.e. t.Errorf(οΏΌ[format], [args]οΏΌ). Hitting Enter on them inserts the text of the variable name and puts your cursor after it. If there is already an appropriately-typed variable with the same name available in your scope, don't start autocomplete. Otherwise start autocomplete, prioritizing the in-scope options of the appropriate type, but the current text that was just inserted is the first item on the list and pre-selected. Hitting Tab right away just accepts the current value, dismissing auto-complete. Hitting it again jumps to the next placeholder if there is one.

This is important, for example if you auto-complete a function like func(err error, b []byte) so you get func([err], [b]) and you hit Enter you get func(err|, [b]) and if you have a variable called err in scope you can just hit Tab right away to jump to [b]. If you don't have one, then autocomplete pops up and you can select your other weirdly-named variable called e.

  • For a field in a struct literal, the placeholder should be the type of what goes there (since the name is already there to the left, you just typed it or whatever). Enter on the placeholder should make a best-effort to insert the proper constructor for that type, so either a struct literal, a slice literal, a "" with your cursor in between like "|", or an empty space with autocomplete started for things like error or int. If it's a struct or a slice literal, it would have & as appropriate if the field is a pointer type. If it's a *string you wouldn't get &"|" since that's invalid, you would just get &| with autocomplete started as a hint that you need to pick an existing string. (Hitting Tab on the placeholder should maybe start autocomplete, since you pretty much never mean to insert a tab character and there's only ever one placeholder in this scenario? Not totally sure if this is the best idea.)

This is important because it lets you populate things quickly. If you want to just pick an existing thing rather than get a whole struct literal, then do Ctrl+Space or Backspace, or better yet just start typing.

  • For a field in a struct literal, the placeholder should be the name of the type. If it's a type in another package, it should still be the name of the type, except the package name appears in the little tag above the placeholder. When you hit Enter then it inserts the package name as part of the constructor. (This was probably obvious.)
  • For a function argument, when you hit Enter and insert the text of the placeholder, and you don't have a matching variable in-scope and autocomplete is triggered, an option near the top should be the constructor for that type.
  • When you are completing a function you can see the signature including the types and stuff (in whatever space you can fit obviously). When you pick that function and it completes in there, along with placeholders, your placeholders now have the variable names but not the types, which you sometimes want to know. It would be great to have it so the little "type tag" above the placeholder appears for whatever placeholder you are currently highlighting, so you know what it wants before you start typing. It would only be for the one you currently have highlighted. This could be toggle-able in Preferences.

Auto-completing...
Screen Shot 2020-06-16 at 4 23 53 PM

Completed!
Screen Shot 2020-06-16 at 4 23 31 PM

Hm, what are the exact types again? What if: (excuse the poor photoshopping)
edited

@tooolbox
Copy link
Author

tooolbox commented Jun 16, 2020

  • Sometimes gofmt gets stuck and just won't format. I have to close the tab and re-open the file and then it works. πŸͺ²
  • Would be nice to have "developer mode" with debug output? Just to help with bug reports.
  • Would be nice to have some sort of more global indicator as to when gopls has "loaded" and is "ready" and so on. In VSCode generally you see certain things underline and files in the listing change color. I know those aren't meant to be indicators of gopls loading, they're indicators of things that gopls is doing (linting or whatever) but having an equivalent in Chime would be handy.
  • Maybe start gopls in the background on startup so Chime is ready to use faster when you do open it? πŸ˜„
  • Typing . in a string shouldn't trigger auto-complete. πŸͺ²
  • Let's say I have a struct with a field of type time.Time. When I'm filling out a struct literal, if I have a function that produces a time.Time, autocomplete will put the function into the field but not actually spell it out with arguments and return values and all that. πŸͺ²
  • Show hidden files & folders in the left pane (greyed out). πŸš€

@tooolbox
Copy link
Author

tooolbox commented Jun 17, 2020

  • When auto-completing a function that has an argument that is itself a function, the "inner" function doesn't need to have its params be placeholders.
  • Just relaunched Chime after a crash and seems like the loader is borked: πŸͺ²
    Screen Shot 2020-06-17 at 11 58 02 AM

@tooolbox
Copy link
Author

tooolbox commented Jul 2, 2020

Version 1.1.7!

Screen Shot 2020-06-29 at 11 58 47 AM

This one's great: pasting and undo/redo no longer trigger completions

@tooolbox
Copy link
Author

tooolbox commented Jul 24, 2020

Version 1.1.8!

Screen Shot 2020-07-23 at 8 15 52 PM

(Seems like I had already downloaded v1.1.8 earlier?)

  • Great on the type-through for " and '. Marked this as fixed!
  • I just reworked my homegrown Monokai theme to be dark instead of light, noticed that (like all operators) <- isn't a different color, which kinda makes it blend in with surrounding text. Will append this to my list up above.
  • Excellent on the indentation when I hit Tab and all that. Seems a lot more robust. Marked as fixed!
  • Page Up/Page Down should move the cursor, not just the viewport.
  • Hitting Save should close autocomplete.
  • I can't seem to close Find In Project! Hitting the X does nothing. πŸͺ²
  • Autocompletion feels more precise or crisp somehow.
  • Autocomplete options don't always sort in the most sensical fashion. Sometimes I'm typing the beginning of something, and it's in the list, but something that is not prefix-matching sorts to the top. πŸͺ²
  • When I'm typing fast and try to choose an autocomplete, sometimes hitting "Enter" inserts a literal enter character instead of selecting the autocomplete. πŸͺ²
  • Whenever the terminal command comes out, it should be chm because chime is hard to type. πŸš€
  • Quotes shouldn't double-up if you have an unmatched one earlier on the line. For example, if you have "the quick brown fox | and you hit " you should get "the quick brown fox "|. Currently Chime produces "the quick brown fox "|" πŸͺ²
  • May have mentioned this earlier, but delimiters if you type an opening delimiter to the left of existing text, it shouldn't double-up. Meaning if you have alpha |beta and you type " it should produce alpha "|beta. Right now chime produces alpha "|"beta. πŸͺ²
  • Sometimes when I hit Save and it goes to format, it lags--I can still move my cursor around with the arrow keys, but the Edited status up top doesn't go away for a few seconds, then it sort of "jumps" (pointer rainbow-balls for a split second, cursor slows and then fast-forwards briefly) and saves. πŸͺ²
  • Weird line number bug; closing & reopening the file fixed it: ( πŸͺ² )

Screen Shot 2020-07-25 at 4 12 48 PM

  • When you have a dark theme, Chime starts up with the light theme, and then changes to dark once you open a file. πŸͺ²
  • Autocomplete seems to trigger at the start of a line, and upon . and possibly other special characters, but often/always not when I'm in the middle of a line of text. πŸͺ²
  • Example of incorrect sorting from auto-complete: I typed fals and hit enter, and it auto-completed to require.False instead of just plain false.

@tooolbox
Copy link
Author

Screen Shot 2020-09-14 at 10 21 30 AM

I missed this release.

@tooolbox
Copy link
Author

Screen Shot 2020-09-14 at 10 16 23 AM

@tooolbox
Copy link
Author

Screen Shot 2020-09-14 at 10 30 46 AM

This is cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment