...To support emoji and screenshots.
-
-
Save tooolbox/5cafd0d07de711b3d554d7b0087760e1 to your computer and use it in GitHub Desktop.
- Using
Cmd+/
on a section of commented-out lines that has a gap in it re-comments them instead of properly un-commenting them. Example:
// hello
// world
// foo
If you select all the above lines together and do Cmd+/
you would expect:
hello
world
foo
But it produces:
// // hello
// // world
//
// // foo
- When auto-completing a series of comma-separated struct-field-accesses for the sake of assignment, struct fields don't auto-complete after the first one. For example, you have
type Foo struct { b []byte; err error }
and you want to doioutil.ReadFile()
and put the result into the struct. If you typemyFoo.|
then you get auto-complete results forb
anderr
but when you keep going tomyFoo.b, myFoo.|
the auto-complete shows you other variables in scope instead oferr
. (You want to keep typing to produce the final result ofmyFoo.b, myFoo.err = ioutil.ReadFile("...")
πͺ² - When auto-completing an argument (to a function or as a return value, for example) normally auto-complete is smart enough to take an address or dereference a pointer based on the type of what's being autocompleted, i.e. it can autocomplete
return myS
toreturn *myStr
orfunc(ap
tofunc(&apple)
. However, if the argument is a struct field, and you've already typed the struct, autocomplete won't automatically dereference or take the address. For example, in the case offunc(fruit.ap
, autocomplete will actually show&apple
in the completion box, but when you accept the completion you getfunc(fruit.apple)
. It does work if you typefunc(fr
and see&fruit.apple
in the completion box, you accept it and getfunc(&fruit.apple)
. So it seems like it just needs some logic to put the&
or*
at the start of the expression if you're already one or more "levels into it". πͺ² - Something that is not done by Sublime but is probably (?) a good idea is "ghosting" through commas in a struct literal. (The term ghosting which I am randomly selecting/coining here means where the editor moves the cursor past/through a character instead of making another one.) So in the way where you have
"hello world|"
and type"
and wind up with"hello world"|
I think it makes sense to haveField: blah|,
and type,
and getField: blah,|
. This comes up when I'm writing out several fields of a struct, the autocomplete is killer both for locating what field I want to insert and then populating the value, particularly if it's a function of some kind. But then after populating the value I have to move my hand to the arrow keys and hitRight
beforeEnter
to go to the next line. Being able to just hit,
I think would be an improvement--could also test it out to see. Note that the context for being able to do this would probably be restricted to when you're in a struct literal.
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]οΏΌ)
. HittingEnter
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. HittingTab
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 likeerror
orint
. 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. (HittingTab
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.
Hm, what are the exact types again? What if: (excuse the poor photoshopping)
- 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 ofgopls
loading, they're indicators of things thatgopls
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 atime.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). π
Version 1.1.8!
(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
becausechime
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 producealpha "|beta
. Right now chime producesalpha "|"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: ( πͺ² )
- 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 torequire.False
instead of just plainfalse
.
https://github.com/org/repo
into myimports
section: (1) start auto-complete wherein it suggestsgithub.com/org/repo
and (2) in that exact scenario, if there's an autocomplete result (from my module cache theoretically) that fuzzily matches such asgolang.org/x/repo
then suggest that as well, in case that's what I really want. π|one.two
then Alt+Right producesone|.two
and then another Alt+Right producesone.two|
. There's probably a bunch of other characters that that applies to but I'm running into it a lot with periods. π₯ π₯|one.two
and pressing Shift+Alt+Right produces[one].two
(where[ ]
are showing the selection). π₯ π₯return
, it should probably only auto-complete to a barereturn
if I'm in a function with named return values, or no return values? Alternatively, if you're in a function where barereturn
isn't valid, auto-complete toreturn
(with a space) as a hint that you need to type some stuff you're going to return.return
could also auto-complete to likely candidates for return that are currently in-scope. It does something like this when you start to type what you're going to return, and even (I think) suggests dereferencing pointers and such, but it could start with you typingret
.illegal character U+2028
while building.