-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
allow gf (go to file) command also for __() method #21
base: master
Are you sure you want to change the base?
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -462,3 +465,27 @@ Execute (edit routes): | |||
|
|||
Expect (generic template): | |||
<?php | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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())