diff --git a/autoload/phpcomplete.vim b/autoload/phpcomplete.vim index f24b404..bbe1365 100644 --- a/autoload/phpcomplete.vim +++ b/autoload/phpcomplete.vim @@ -274,6 +274,8 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{ " }}} elseif context =~? 'implements' return phpcomplete#CompleteClassName(a:base, ['i'], current_namespace, imports) + elseif context =~? 'extends\s\+.\+$' + return ['implements'] elseif context =~? 'extends' let kinds = context =~? 'class\s' ? ['c'] : ['i'] return phpcomplete#CompleteClassName(a:base, kinds, current_namespace, imports) @@ -1208,7 +1210,7 @@ function! phpcomplete#GetCurrentInstruction(line_number, col_number, phpbegin) " \ '!', '@', '%', '^', '&', \ '*', '/', '-', '+', '=', \ ':', '>', '<', '.', '?', - \ ';', '(', '|', '[' + \ ';', '(', '|', '[' \ ] let phpbegin_length = len(matchstr(getline(a:phpbegin[0]), '\zs', \ res) + call cursor(96, 48) + let res = phpcomplete#GetCurrentInstruction(96, 48, [1, 1]) + call VUAssertEquals( + \ 'class Foo extends Bar implements ArrayAccess, It', + \ res) + silent! bw! % endf diff --git a/tests/fixtures/GetCurrentInstruction/instructions.php b/tests/fixtures/GetCurrentInstruction/instructions.php index 171dade..38fcf41 100644 --- a/tests/fixtures/GetCurrentInstruction/instructions.php +++ b/tests/fixtures/GetCurrentInstruction/instructions.php @@ -92,3 +92,5 @@ public function bar() ; return $foo-> // cursor here ; + +class Foo extends Bar implements ArrayAccess, It