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
In completion mode, typing a key other than or visible navigates to the next placeholder.
The Tab key navigates between placeholders.
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.
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
YCM
s suggested behaviorlikeSome(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.