jerrymarino / iCompleteMe

Swift comprehension in Vim: code completion and diagnostics
GNU General Public License v3.0
56 stars 3 forks source link

Placeholder Jump behavior #2

Closed jerrymarino closed 7 years ago

jerrymarino commented 7 years ago

Code even faster to meet those deadlines 💣

This patch implements placholder navigation. It implements a state machine to track the users behavior and trigger jumping at the right time.

Design:

I think the original YCM behavior is good for C++, C, python, and other languages without named parameters - and it need some adjusting to be idiomatic for Swift. It doesn't work with a large subset of code out there - ( i.e. 5+ word long method signatures )

Instead Implement Placeholder Jumping

Alternatives considered ( legacy YCM logic ):

If we follow YCMs suggested behavior likeSome(uberCanonical:factoryManager:runnerDelegate:factoryEmpireBuilder:immutableMangerBuilder:withOptions:inContext:successBlock:progressBlock:failureBlock:)

Would complete to: likeSome

This will not be an option: it's a poor experience for most code out there. By default icmd will be hardcoded to return these placeholders always.

TODOs are inline

It should feel as natural as possible.

Consider what a great job the Xcode team has done here. out

jerrymarino commented 7 years ago

This also includes fixes for backend crashes: https://github.com/jerrymarino/swiftyswiftvim/pull/9

jerrymarino commented 7 years ago

out