-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Support comma completion in functions #12
Comments
Not sure I should add it. When completing after a comma, you wouldn't want to overwrite the already written arguments, so I need to know both which argument the user is currently entering and to which argument it corresponds in the calltips returned from DCD - both require D parsing which is quite complex and I don't want to implement in Vim... |
I don't think so, unless I'm misunderstanding you. DCD doesn't report each argument individually it just gives calltips for the entire function. I hacked together something when Schott first added it, not sure if it's acceptable or not. You can check out the diff here https://gist.github.com/rsw0x/bc17e04cd14b811da900#file-gistfile1-txt I basically just looked backwards for a comma if a parenthesis was found, and triggered it if so. |
Finding what to feed to DCD is not the problem. Let's, for example, say this is our buffer: void foo(int x) {}
void foo(int x, string s) {}
void foo(int x, char c) {}
void main() {
foo(1, The byte position after the
So far, easy enough. But what now? Dutyl offers calltip completion by offering complete calls with the same argument names as the ones in the function signature, so it can offer to complete Now, based on this example it looks very easy, since we can just count commas, but what if we have complex types in the expression, like |
dlang-community/DCD#193
The text was updated successfully, but these errors were encountered: