codota / tabnine-sublime

Tabnine Autocomplete AI: JavaScript, Python, TypeScript, PHP, C/C++, HTML/CSS, Go, Java, Ruby, C#, Rust, SQL, Bash, Kotlin, Julia, Lua, OCaml, Perl, Haskell, React
https://www.tabnine.com/install/sublime
MIT License
194 stars 36 forks source link

Enhancement: close half-open braces, use the snippet system to smartly place the point #3

Open Lucretiel opened 5 years ago

Lucretiel commented 5 years ago

Suppose I'm creating a new rust struct, with some derive attributes at the top. I type:

#

And TabNine suggests [derive(Clone,.

This is a good suggestion, but I'm very much used to my editor automatically closing my braces. What I'm suggesting, therefore, is that the following flow occur (█ indicates the suggestion/location of the point; I'm not sure how to indicate this in the UI. Perhaps a highlighted character?)

#[derive(Clone, █)]
// <tab>
#[derive(Clone, Default)█]

// <tab>
#[derive(Clone, Default)]█

This can probably be implemented "dumbly", that is, it can use simple syntax analysis that examines the output of TabNine's suggestion, and simply closes all detected half-open braces.

zxqfl commented 5 years ago

Closing of half-open braces has been added. Snippet support is still pending. (Supporting the workflow you describe requires a rethinking of the current interface, since pressing tab after a completion currently selects the next completion.)

Lucretiel commented 5 years ago

Yeah, I was thinking about that, too. You'd have to do some extra typing to get out of the tabnine context. Still, glad to hear that brace closing works!

On Sat, Nov 24, 2018, 2:50 PM Jacob Jackson <notifications@github.com wrote:

Closing of half-open braces has been added. Snippet support is still pending. (Supporting the workflow you describe requires a rethinking of the current interface, since pressing tab after a completion currently selects the next completion.)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/zxqfl/tabnine-sublime/issues/3#issuecomment-441391470, or mute the thread https://github.com/notifications/unsubscribe-auth/ABvSraLmh4jSkq19NSF1jKDGC_-p3pD4ks5uyaLngaJpZM4YPdhK .