You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if I'm using multiple traits in a class like this:
class Foo {
use BarTrait, FoobarTrait;
}
I cannot import the namespace for the second trait. It says that import already exists. The first one gets imported correctly, it doesn't matter if I try to import the first or the last trait's namespace.
If I have just one use statement per line, I can import all of them:
class Foo {
use BarTrait;
use FoobarTrait;
}
This second example works without any issues.
Thanks for doing this plugin, I use it daily. If I new VimL I'd contribute :(
The text was updated successfully, but these errors were encountered:
it's likely that the pattern to match namespace lines also match trait use line(more often just the cursor line), thus imports exists.
I found that an easy solution is not to match the whole file, instead from the first line to the line above the current, just found the plugin/phpns.vim and change as following
function!s:searchCapture(pattern, nr)
lets:capture=0let str =join(getline(0, line('$')),"\n")
let haha =substitute(str, a:pattern, '\=[submatch(0), s:saveCapture(submatch('.a:nr.'))][0]', 'e')
returns:captureendfunction```
let str =join(getline(0, line('$')),"\n")
let str =join(getline(0, line('.')-1),"\n")
One small bug I noticed:
if I'm using multiple traits in a class like this:
I cannot import the namespace for the second trait. It says that import already exists. The first one gets imported correctly, it doesn't matter if I try to import the first or the last trait's namespace.
If I have just one
use
statement per line, I can import all of them:This second example works without any issues.
Thanks for doing this plugin, I use it daily. If I new VimL I'd contribute :(
The text was updated successfully, but these errors were encountered: