allow gf (go to file) command also for __() method#21
allow gf (go to file) command also for __() method#21thyseus wants to merge 3 commits intonoahfrederick:masterfrom
Conversation
|
Thanks! This addition is welcome, but the proposed code change has a couple problems:
Please extend the existing pattern to match Let me know if you need further guidance. |
|
@noahfrederick Yes, i need some guidance. I almost got the regular expression right to also 'listen' on |
noahfrederick
left a comment
There was a problem hiding this comment.
Sorry for being slow to get around to this! Please see my comment.
b20a49b to
93b8bcb
Compare
|
Do you want to try adding test coverage? It would involve using vader.vim to make assertions about the output of The test suite actually involves running the tests against a new Laravel project. The setup script is here, and you can see how a test like this works here, and you can run the test suite with: vim -Nu test/fixtures/init.vim -c 'Vader! test/*' |
|
Yes - i will try in this running week. Awesome that there is a testing suite for vim... :) |
…style (including HasFactory)
|
Hey @noahfrederick i think i am far to the goal, but it seems like the vim instance that vader.vim starts with your instructions does not have the vim-laravel module loaded. Setting the cursor the first a of auth on Thanks a lot ! |
noahfrederick
left a comment
There was a problem hiding this comment.
it seems like the vim instance that vader.vim starts with your instructions does not have the vim-laravel module loaded.
That's possible. How are you invoking vader.vim? The test/fixtures/init.vim init file assumes all the required plug-ins are installed to the current working directory. You will probably need to adjust that. Or you could just run the tests using your own vimrc instead, i.e., vim -c 'Vader! test/*'. That's probably easier.
|
|
||
| Expect (generic template): | ||
| <?php | ||
|
|
There was a problem hiding this comment.
Let's move these new tests to their own test file, tests/goto.vader (matching the autoload script name), since we're testing a different type of functionality.
| After (clean up buffer): | ||
| bdelete | ||
|
|
||
| Before (blade file with trans() function): |
There was a problem hiding this comment.
My understanding is that Before and After blocks are executed again for every test in the test file, so there should only be one of each per file. You can do additional setup for a single test in an Execute block instead.
| Do (Move to (a)uth.failed, jump to translation file): | ||
| i{{ __('auth.failed') }}\<Esc>0fagf | ||
|
|
||
| Execute: | ||
| AssertEqual expand('%'), 'resources/lang/auth.php' |
There was a problem hiding this comment.
It's good to exercise the gf mapping at least once, as you have here, but it would also be valuable to test the output of laravel#goto#filetype_php() and laravel#goto#filetype_blade() directly. They output strings that are executed as navigation commands:
AssertEqual laravel#goto#filetype_blade(), 'Elanguage en/auth'
(which is an alias for trans())