shawncplus/phpcomplete.vim

`$this->` autocompletion not working outside namespaces

Closed this issue · 2 comments

cprn commented

Example

I might be stupid here but consider the following two almost identical files:

  • working autocompletion inside the Facebook\WebDriver\Remote namespace:
<?php
namespace Facebook\WebDriver\Remote;

$drv = RemoteWebDriver::create();
$drv-><C-x><C-o> # list of methods
  • not working autocompletion in global namespace:
<?php
use Facebook\WebDriver\Remote\RemoteWebDriver;

$drv = RemoteWebDriver::create();
$drv-><C-x><C-o> # pattern not found

The above is a minimal example from the bigger code sample that runs correctly (in both cases). Note the following works correctly as well (in both cases):

RemoteWebDriver::<C-x><C-o> # list of methods

Prerequisites

  • dependencies:
mkdir test && cd test
curl -sS https://getcomposer.org/installer | php # composer local install
./composer.phar require facebook/webdriver       # selenium webdriver
  • installed shawncplus/phpcomplete
  • installed patched ctags
  • generated tags file: ctags -R --fields=+aimS --languages=php

Thank you very much for the exemplary bug report!
I think I've fixed the bug, please try again with the current master.

cprn commented

Awesome! I confirm current master works without a problem with global namespace.