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 Apr 9, 2020

  • Feature: When you highlight something in the editor, would be good to trace-highlight all other occurrences of that text. 🐌
  • Bug: Sometimes Chime gets "stuck" so that clicking on an item in the sidebar opens a new window instead of a new tab. πŸͺ²
  • Bug: Clicking an item in the sidebar makes the sidebar scroll to the top (shouldn't move at all). πŸͺ²

@tooolbox
Copy link
Author

tooolbox commented Apr 9, 2020

(Moved from above)

Feedback

  • The fact that Highlight Structure persists on the last-highlighted item even when you move your mouse away is slick.
  • The way Ctrl+Tab and Cmd+` are handled is perfect. πŸŽ‰
  • Love the little rotating hexagons throughout the site and the app. They are subtle, almost easter-egg style. πŸ₯š

Important

  • The case-sensitivity setting for Find should remember itself globally; right now it defaults to case-sensitive for every tab you newly open. πŸ”₯ πŸͺ²
  • The Find In File feature doesn't need to show the matches in the left folder tab--especially if this impacts performance in the slightest. Find In Project can take time, but Finding in a file should be instant; right now I have a quarter/half second lag when doing a regular Find In File in a big project. πŸ”₯
  • Dragging a file from Finder pastes the path; it should open the file as a tab in the current window.

(Hopefully) Quick Wins

  • When holding alt or cmd and hovering over a clickable item, would be good to have the pointer turn into a click-hand. This would include package imports at the top of the file.
  • Would like to be able to see the changelog by version. (Done in v1.1.6)
  • Would like to see the project folder name in the top bar.
  • Alt+Click on an import statement (or on an entry in a go.mod) could open the package in godoc.org or pkg.go.dev using your browser. Alternatively, maybe Cmd+Alt+Click would open in godoc/pkg.go.dev (configurable from Preferences) whatever type, method, etc. you clicked. πŸŽ‰

General

  • Alt+Tabbing makes any auto-completion placeholders disappear. πŸͺ²
  • Shouldn't open two double-quotes if you have an open set already: "This is a string"" <- shouldn't produce this (same with parentheses and probably all the other open/close characters) It seems like this is my muscle memory making me type a " at the end of a line; Sublime and other editors somehow figure out what you intend and do a replacement. After further observation, the ) and } characters do properly do a "replacement" when you "type over" them at the end of a line, but the " and ' characters don't do this, and should. πŸ”₯ (Fixed in v1.1.8)
  • Ideally, while you are finding-in-file with Cmd+F, hitting Enter repeatedly would find the next occurrence, and Shift+Enter would go to the previous occurence. Using Esc to kill find-mode would then return Enter to its usual behavior. πŸ”₯
  • When doing Find In File, should highlight automatically as you type. πŸŽ‰
  • Holding alt/cmd highlights structure, alt+click brings up the signature/typedef and cmd+click jumps to definition. Would it be good to have hold-cmd show signature/typedef and cmd+click jump to definition? Might not be performant enough to show details while hovering. 🐌
  • If you're on the last line of a file, the autocomplete drop-down falls off the bottom of the screen; should reverse and go upwards. πŸͺ²

Not Important

  • Show Structure on a case or default in a switch could have a line down the side to where that entry stops. 🐌
  • Show Structure on a goto could show a line out to the gutter, then up/down and back out to the goto label. 🐌
  • When you do Cmd+Shift+\ to show all tabs, should be able to use arrow keys to navigate around the tabs and pick the one you want. 🐌
  • No way to enter my license now that I've bought it! This is actually described in the email I received the license in...

Syntax Highlighting 🐌

  • Char like 'c' should have a different scope than string.
  • Formatters like %s %v %#v %+v in strings.
  • Operators == = := != + / - * & && ++ -- <- etc.
  • Builtin functions len append panic etc.
  • Goto labels.
  • Field names in struct literals as different scope, so that it can be turned off.
  • Function and method declarations as a scope (seems to exist, doesn't work though).
  • Parameters in function/method declarations as a scope.
  • Statements as a scope differentiated from keywords.
  • Some scopes don't seem to do anything: syntax.identifier.variable and syntax.identifier.function and syntax.identifier.variable.local and syntax.identifier.definition.function πŸͺ²

@tooolbox
Copy link
Author

  • Enhancement: Ability to do "New Folder" from the sidebar
  • Enhancement: When doing "New File" or "New Folder" from the sidebar, should immediately open the "Rename" dialog so you can name what you just created

@tooolbox
Copy link
Author

  • Feature: Cmd+C, Cmd+V to copy & paste an entire line (when nothing is selected)
  • Bug: Sometimes gofmt on save lags for ~3 seconds. At first thought it was because I didn't have the whole file loaded, but tests seem to show it's not related. Further, the actual text seems to adjust itself instantly, but the File menu up top stays highlighted during the lagtime, and when it's complete the sidebar jumps around, so possibly it's a file-saving bug rather than a gofmt bug. πŸ”₯ πŸ”₯ πŸͺ²
  • After opening a file, Chime should start "preloading" it. Currently the rest of the file doesn't necessarily load, and then you scroll down and you "bounce" off the "bottom" which is really halfway down the file; then more loads and you can scroll down further. πŸ”₯ πŸͺ²
  • Enhancement: When searching in a file, Chime lags, and then there may be no results. Due to the lag and then lack of results, it's hard to tell whether or not it's still searching or if it's done. Ideally (1) there's no lag and (2) there's a clearer indication that there are no results. πŸ”₯
  • Enhancement: When closing tabs, ideally wait a second or so after shifting the tabs to resize them. Otherwise if you need to close a bunch in a row, it's a moving target. (Chrome and Sublime both do this.) 🐌
  • Feature: Make "Show Structure" happen automatically for whatever scope your cursor is in. Hotkey to turn this on/off. 🐌
  • Enhancement: If you leave your pointer over, say, a function, then if you Alt/Cmd+Arrow to move around, you will get this flash of "Show Structure" which is a little distracting. This can happen repeatedly as you navigate the cursor around. Given that you dropped/left your pointer somewhere in the middle of the screen and are moving your cursor around to edit text, it's pretty certain this is not your intended behavior. The "Show Structure" does disappear as soon as you move the cursor, which is correct, but suggested improved behavior is: As soon as you move the cursor, don't "Show Structure" again until the mouse is moved, i.e. even if the pointer is over something and Alt/Cmd is pressed, if your cursor has moved since your mouse stopped moving, don't "Show Structure". So if you drop your cursor over something and then Alt+Arrow you will get a brief flash the first time, but then it won't continue to flash with further Alt+Arrow presses. 🐌
  • Enhancement: The saved/unsaved status of a file should be shown on each tab rather than the top bar.

@tooolbox
Copy link
Author

tooolbox commented Apr 10, 2020

  • Bug: Closing the Find bar gives a 2-second lag. πŸͺ²
  • Bug: When first opening Chime, format-on-save doesn't work for ~15 seconds. The file saves but no formatting occurs. πŸͺ²
  • Feature: Word wrap setting by filetype (most code probably doesn't want to word wrap; markdown should word wrap).
  • Bug: Usually (in Sublime) when doing a gofmt, it ensures that there's an empty line at the end of the file. Formatting in Chime doesn't seem to do this. πŸͺ²

@tooolbox
Copy link
Author

tooolbox commented Apr 11, 2020

  • Feedback: Selecting text and then hitting " puts quotes on both sides of your selection. Excellent!
  • Enhancement: Don't do double " or ' etc. while you're in a comment block. This is fine actually. Don't do double " or ' if the character immediately to the left is a word character. For example Joe| + ' should produce Joe'| and not Joe'|'.
  • Bug: Auto-complete gives multi-level options before single-level options sometimes. For example new(net.Listener).A auto-completed will give you .Addr().String() higher on the list than .Addr() but should be the other way around.
  • Enhancement: When you type " and it produces "|" (the pipe is the cursor there) then if you hit backspace it should remove both quotes. Same goes for { and ( etc. πŸ”₯ πŸ”₯ πŸŽ‰
  • Bug: Sometimes crashes when pasting text. πŸͺ² πŸͺ² (Fixed in v1.1.1)

@tooolbox
Copy link
Author

tooolbox commented Apr 11, 2020

  • Feature: Highlight containing scope simultaneous to highlighting whatever you're pointing at. I.e. if you're holding Alt and mousing-over a function argument, highlight the function structure, too...different color?
  • Bug: Tried to Jump To Definition of https://godoc.org/github.com/golang/mock/gomock#Any and got a crash, twice in a row. πŸͺ² (Fixed in v1.1.1)
  • Feature: The Tab character should allow you to pick from the autocomplete menu, seems like it doesn't, at least sometimes. (Added in v1.1.3)
  • Feature: When opening a new file, before it's saved as a .go it would be good to somehow activate syntax highlighting. Maybe heuristically, if there's a package X statement at the top, or a menu/touchbar command.
  • Feature: When doing Cmd+N or Cmd+T to open a new file/tab, if you then save, it often puts you in a seemingly random directory. (Even Sublime does this wrong, so, not a surprise.) It would make sense to default it to the directory of whatever project you executed the "new" command from. 🐌

@tooolbox
Copy link
Author

tooolbox commented Apr 11, 2020

  • Enhancement: Show-definition with a large type definition should maybe wrap, multi-line. Single line is fine but if it goes over a certain size/width should probably nicely format the struct definition, the way it would look if it were gofmt-ed.

show-def-wrap

Maybe it does single line by default but if the symbol is a struct with struct tags then it's multi-line? Semicolon-delimited name/type pairs are fine to read, but I think adding in struct tags makes it jumbled.

  • Bug: Struct tags in "show definition" popups should be formatted like
`json:",omitempty"`

rather than "json:\"omitempty\"" πŸͺ²

@tooolbox
Copy link
Author

tooolbox commented Apr 11, 2020

  • Feedback: It's great to be able to have your cursor in a struct literal, do Cmd+Space and be able to output one of the fields. It intelligently sees what fields are already in the struct literal, excluding them from the list. It sees if the struct literal is multiline or single-line, and if it's multiline it inserts a comma at the end of the line. This is fantastic.
  • Enhancement: When auto-completing a struct field i a single-line literal, it doesn't do commas, which is fine most of the time. However if you're inserting a value into the middle of a single-line struct literal, you will want a comma. 🐌
  • Feedback: It's great to be able to have your cursor in a slice, do Cmd+Space and be able to output one of the structs that belongs in the slice.
  • Enhancement: When auto-completing an item in a slice, it would be good to have a comma at the end of the line if it's a multi-line slice literal.
  • Enhancement: When auto-completing an item in a slice, it would be good to have the option to use the type-less variation i.e. just { } instead of &package.Type{ } since as of Go 1.something the type isn't needed for each struct in a slice literal.
  • Enhancement: When auto-completing and you have a placeholder for a slice, you should be able to just hit Enter and it outputs a slice literal that matches the required type. It also puts the cursor in the middle of the slice so you can start entering data into it. If you were auto-completing a function and there are further arguments, you can hit Tab to jump out the slice literal and go to the next argument (such as, for example, if you want the slice to be empty).
  • Enhancement: When auto-completing and you have a placeholder for a struct or struct reference, you should be able to just hit Enter and it outputs a struct/struct reference of the required type, and puts the cursor in the struct so you can start entering fields. If you were auto-completing a function and there are further arguments, you can hit Tab to jump out of the struct literal and go to the next argument (such as, for example, if you want the struct to be empty).

@tooolbox
Copy link
Author

version-1 1 1

Version 1.1.1 released! Updating the above based on this.

@tooolbox
Copy link
Author

tooolbox commented Apr 13, 2020

  • Enhancement: When you've just opened a new file/project, sometimes Show Definition (via Alt+Click) is not immediately available, probably because gopls is still loading & indexing. In this case, Alt+Click doesn't activate, but there is also no visual indicator. Possibly the loading spinner should be running while gopls is indexing, or it should give the loading spinner when you Alt+Click before gopls is ready, and persist it until the Show Definition finally goes through.
  • Enhancement: Show <search icon> 0 in the status bar if there are no find results. Currently you are given a find-count when you do a search, but if your search returns no results, the status bar shows - as if you weren't searching at all. Might be good visual feedback to have - while it's searching, and then show <search icon> 0 if there are no results. This tells you definitively that there are no results and also helps you know when searching is done.

With results:
with-results

Current with zero results: (looks like you're not searching at all)
zero-results

  • Feedback: The Find counter increments upward in realtime as Find In Project works its magic, which is great.
  • Enhancement: Show the Loading spinner while Search is running?

@tooolbox
Copy link
Author

tooolbox commented Apr 14, 2020

  • Bug: In certain conditions, Undo will incorrectly create duplicate characters such as for " or { (this is part of the open/close thing that Chime does). This can make it so that repeated Cmd+Z will not actually reproduce the original text content of your document. πŸͺ² πŸ”₯ πŸͺ² πŸ”₯ Here's the breakdown:
    • Type " -> "|"
    • Type Right -> ""|
    • Type Backspace -> "|
    • Type Cmd+Z -> ""|" (extra quote produced)
  • Bug: When auto-completing a string field, if you type " then it will put quotes around the placeholder, which is not necessarily incorrect, but the 2nd quote is a smaller font! Aside from the font size bug, it would ideally create "|" rather than "<placeholder>". πŸͺ² Sample:

Screen Shot 2020-04-13 at 7 37 31 PM

  • Feedback: Wow, when I have a function return value of *foo and a variable var apple foo and I auto-complete return ap its top suggestion is return &apple, i.e. it auto-completes to taking the address of the variable because it knows the return type is a pointer. Wow, that's great.
  • Bug: Sometimes when doing format-on-save, the focus jumps around in the file. It should keep the same viewport as much as possible. πŸͺ² πŸ”₯

@tooolbox
Copy link
Author

tooolbox commented Apr 14, 2020

  • Enhancement: Using Cmd+/ to comment a block of code should comment it at its current indentation. Otherwise when you format-on-save the whole code block shifts.
  • Feature: If your cursor is on the far left side of the screen and the line above you is indented some amount, then hitting Tab would indent to match the line above you, instead of just inserting one tab character. (Added in v1.1.8!)
  • Feature: If I do a go get -u xyz.com/user/module in the project where I have Chime open, this will change the version of a particular package, and possibly the API as well. I've noticed when I've done this that the autocomplete doesn't update, but I would expect it to. Possibly some gopls cache needs to be emptied.
  • Feature: Starting auto-complete manually via Ctrl+Space or other means would ideally focus on the cursor, even if it's off-screen.
  • Bug: If there is a word character immediately to the right of your cursor, and you hit a character that normally gets automatically closed (" or ' or ( or {) then don't auto-close. I.e. |The... + ( should not produce ()|The... as it currently does. πŸ”₯ πŸͺ²

@tooolbox
Copy link
Author

  • If Search is open, hitting Escape should re-focus the cursor on the text. As of v1.1.1 hitting Escape does properly close Search but I have to then click on the text window to get my cursor back. (This may be after hitting Cmd+G a couple of times, not sure.)

@tooolbox
Copy link
Author

Screen Shot 2020-04-25 at 8 00 31 PM

Version 1.1.2 released!

Fix: Certain autocomplete results could render incorrect placeholder label/content

This sounds perhaps like the issue of small " or } characters after a placeholder label/content but I seem to still have this issue after the upgrade.

Whitespace characters are cool though! And gopls 0.4.0 gives support for the -modfile flag that's been added to go 1.14, which should help things.

@tooolbox
Copy link
Author

tooolbox commented May 3, 2020

Screen Shot 2020-05-03 at 4 12 23 PM

Version 1.1.3 released!

Feature: control over line wrapping behavior

This is fantasticβ€”checking off that feature above, based on this!

Feature: tab completion acceptance, with optional partial matching

That seems like "hitting tab with the autocomplete menu open accepts (activates) that particular completion", just to state it verbosely. (Not sure what the "optional partial matching" part is.) I checked and it works great, you can hit Tab to pick a completion now! Checking off my note above.

@tooolbox
Copy link
Author

tooolbox commented May 16, 2020

Screen Shot 2020-05-16 at 2 55 55 PM

Version 1.1.4 released!

Looks like they are all great bugfixes, although not things I had personally encountered. (Admittedly my Go writings have ebbed the last few weeks.) I do think that text view incorrectly sized until the containing window itself was resized did happen to me once.

Altogether, awesome! πŸ‘

@tooolbox
Copy link
Author

tooolbox commented Jun 13, 2020

I missed v1.1.5!! 😱

Well, now we have v1.1.6!

Screen Shot 2020-06-13 at 2 34 00 PM

Well how about them apples? Release notes on the website and a link from within the app! Checking that point off my wishlist...

Not familiar with the other two bugs/points mentioned.

Okay, how about v1.1.5?

Screen Shot 2020-06-13 at 2 37 08 PM

Hold on, hold the phone, what the flip? Let me go try this...

EDIT: Works great!

@tooolbox
Copy link
Author

tooolbox commented Jun 13, 2020

  • Hotkey for Show Semantic Details so you don't have to go the mouse. πŸš€
  • Currently, autocomplete uses the package name as the placeholder text (with the rest of it in a little tag above it, before you accept the autocompletion) but I think the name of the thing should be primary, and the package name secondary. If everything's from the same package, the placeholders are all the same, which isn't super helpful. πŸ”¨
  • If you start a function call and then auto-complete it, would be good if you auto-complete generated placeholders for the assignment variables, as well. Like, you type ioutil.ReadFile and when you accept auto-complete you get <[]byte>, <error> := ioutil.ReadFile(<filename>). This could also be a specific mode, like you use Cmd+Enter to accept it. For bonus points, if there's already an assignment in place, detect if the user has typed the wrong number of arguments, and add/remove arguments as necessary. πŸš€
  • Syntax highlighting for .proto files.
  • Format-on-save nukes placeholders 😒 (I do understand that this would take some work to implement)
  • If I have fully typed an appropriate autocomplete result, autocomplete should hide. This would include keywords such as return or else. For example if I'm at the end of a function and I type return then autocomplete should hide. Also a close parentheses, I think?
  • I guess autocomplete should suggest keywords, too? Like, if I start typing ret then it should suggest return. Also builtin types like error.
  • Would be good if syntax highlighting could identify builtin types like error.
  • Sometimes, but not always, autocomplete will "restart". Let's say I type co and then ctrl+space, and select const. Sometimes it will produce const and sometimes it will "restart" and produce coconst. πŸͺ²
  • When I type something, and then click away/off, sometimes the auto-complete appears a split second later. In other words, clicking away currently closes autocomplete, but it should also deactivate the timer if autocomplete is about to pop up. πŸͺ²
  • Similarly, I type something and then cmd+arrow to the end of the line, auto-complete appears a split second later. πŸͺ²
  • Can you please bundle SF Mono and make it the default, like Xcode? πŸ˜„ (The answer is no, can't be used in commercial projects. They should make an exception heh.)
  • When opening a (locked?) file that doesn't fit in the window horizontally, when the file isn't fully loaded (scrolling down makes more of it appear) I can't scroll all the way to the left. When I do, it jumps a little to the right, approximately but not exactly a tab width. πŸͺ² (Fixed in v1.1.7)
  • Pasting shouldn't trigger autocomplete. (Fixed in v1.1.7)
  • Hitting Cmd+Left correctly goes to the start of the text on the current line, but Cmd+Shift+Left still highlights all the way to the beginning of the line, regardless of where the text starts.
  • When typing while the autocomplete is showing, typing a _ character (even if it appears in the autocomplete options) causes the autocomplete to dismiss.
  • Sometimes autocomplete placeholders disappear for no apparent reason.

@tooolbox
Copy link
Author

tooolbox commented Jun 16, 2020

  • Would like to have auto-complete on import paths, based on other imports in the project or just what's available in my on-disk module cache. For bonus points, ensure they're correctly versioned i.e. "github.com/org/repo/v2" as an auto-complete option, if that's an/the appropriate import path. For extra bonus points, if I paste the URL https://github.com/org/repo into my imports section: (1) start auto-complete wherein it suggests github.com/org/repo and (2) in that exact scenario, if there's an autocomplete result (from my module cache theoretically) that fuzzily matches such as golang.org/x/repo then suggest that as well, in case that's what I really want. πŸš€
  • Specifically on moving Alt+Left and Alt+Right, periods should be word boundaries. So if I have |one.two then Alt+Right produces one|.two and then another Alt+Right produces one.two|. There's probably a bunch of other characters that that applies to but I'm running into it a lot with periods. πŸ”₯ πŸ”₯
  • Note that the above point about Alt+Left and Alt=Right also applies when you're holding shift. So having |one.two and pressing Shift+Alt+Right produces [one].two (where [ ] are showing the selection). πŸ”₯ πŸ”₯
  • Typing a period in a comment shouldn't trigger autocomplete. πŸͺ²
  • In terms of autocompleting return, it should probably only auto-complete to a bare return if I'm in a function with named return values, or no return values? Alternatively, if you're in a function where bare return isn't valid, auto-complete to return (with a space) as a hint that you need to type some stuff you're going to return.
  • Auto-completing 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 typing ret.
  • Shift+tab should undo Tab (delete a tab character)
  • Somehow I managed to get illegal character U+2028 while building.

@tooolbox
Copy link
Author

  • 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

@tooolbox
Copy link
Author

tooolbox commented Jun 16, 2020

  • 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 do ioutil.ReadFile() and put the result into the struct. If you type myFoo.| then you get auto-complete results for b and err but when you keep going to myFoo.b, myFoo.| the auto-complete shows you other variables in scope instead of err. (You want to keep typing to produce the final result of myFoo.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 to return *myStr or func(ap to func(&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 of func(fruit.ap, autocomplete will actually show &apple in the completion box, but when you accept the completion you get func(fruit.apple). It does work if you type func(fr and see &fruit.apple in the completion box, you accept it and get func(&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 have Field: blah|, and type , and get Field: 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 hit Right before Enter 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.

@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