-
Notifications
You must be signed in to change notification settings - Fork 769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert insertion_text field to typed_text and completion_chunks #664
Conversation
Codecov Report
@@ Coverage Diff @@
## master #664 +/- ##
==========================================
+ Coverage 94.84% 94.85% +<.01%
==========================================
Files 79 79
Lines 5297 5302 +5
Branches 171 171
==========================================
+ Hits 5024 5029 +5
Misses 228 228
Partials 45 45 |
I'm not sure if we talked about this in the past but is the void foo( int a, int b, int c, int d, int e ); a completion request for such function would have the [
{"tex": "foo(", "placeholder": false},
{"tex": "int a", "placeholder": true},
{"text": "int b", "placeholder": true},
{"text": "int c", "placeholder": true},
{"text": "int d", "placeholder": true},
{"text": "int e", "placeholder": true},
{"text": ")", "placeholder": false}
] couldn't we simplify this to: {
"start": "foo(",
"end": ")",
"parameters": [ "int a", "int b", "int c", "int d", "int e" ]
} ?? Do you see any drawback doing it like this? Anything that will prevent us in the future to do something? |
The syntax varies with languages. |
@vheon If I understand what @Qusic is saying, the "placeholder" concept comes directly from libclang. And we can't just send a list of params because as his example shows, that doesn't work right with objc. Also, having the placeholder flag does not preclude us from having explicit parameters in the future. I'm fine with this API, though I haven't looked at the code yet (let's get agreement on the API first). @micbou @puremourning Thoughts? |
Reviewed 17 of 17 files at r1. Comments from Reviewable |
This API looks good right now. We can do small changes later when face any limitations for other languages. |
Review status: all files reviewed at latest revision, all discussions resolved. Comments from Reviewable |
@micbou @puremourning Is this OK with this API ? |
☔ The latest upstream changes (presumably #843) made this pull request unmergeable. Please resolve the merge conflicts. |
Closing PR as its not moving forward. |
insertion_text
is removed in favor oftyped_text
andcompletion_chunks
.typed_text
is inspired by clang. It is the string that the user is expected to type to match exactly this completion suggestion, which can be used for filtering, sorting and also grouping when function overloads are represented by separate completion suggestions.In
BuildCompletionData
,typed_text
is the only required parameter,completion_chunks
defaults to[{text: typed_text, placeholder: false}]
, for the sake of convenience.This change is