omnicomplete not showing typed properties
Closed this issue · 9 comments
I can't get the omnicomplete menu to show typed properties.
Generating a tags file did not seem to help, even I can see it contains the typed properties.
example of issue:
class Thing {
public $a;
public $b;
public string $c;
}
$thing = new Thing();
$thing->with the cursor placed after the arrow $thing-> doing c-x c-o shows the omnicomplete menu, but property c is missing:
Hi,
Thank you for the nice report! These declarations are not supported at the moment. Some patterns to pick up variables needs to be adjusted to allow for the new syntax
where in the source are these patterns?
typed properties are listed in the tags file. does this plugin not load from the tags file?
The plugin uses the tags files to locate classes, but reads the source files for the actual content.
The pattern trying to pick up variables should be this:
https://github.com/shawncplus/phpcomplete.vim/blob/master/autoload/phpcomplete.vim#L1282
Adding the new keywords might work here, but since now there are typehints here, the type-detection should use these too (same way it's doing it from doctypes)
Added support the new readonly keyword alongside of nullable types (at least for completion).
Using the hinted types will have to be done still. Lemme know if this works for you and feel free to re-open the ticket if you see something wrong
It works! 👍
edit: never mind the error, I installed it the wrong directory
works perfectly when installed correctly 💯
hi guys,
just want to remind you to send an update to vim/vim if you think this can and should be included with Vim at some point :) thanks!
Hi @chrisbra!
Excuse my ignorance, but do you know what's the system now to send in patches for runtime updates?
The version included with the runtime install is a derivative of this repo's code indeed (stripped down a bit, different code formatting, etc), I used to just email patches to Bram Moolenaar, but sadly this is not an option anymore.
no problem.
There are several options (in the order of preference):
- create a PR at the vim repository
- send via mail via the vim-dev mailinglist
- send directly to me
Either one should work.
Thanks!
