phpactor: Crash when trying to go to definition: undefined variable: g:phpactorProjectRootPatterns
phpactor crashes when I try to use GotoDefinition on the DoctrineCommand class here: https://github.com/doctrine/DoctrineFixturesBundle/blob/master/Command/LoadDataFixturesDoctrineCommand.php#L30
Error detected while processing function phpactor#GotoDefinition[1]..phpactor#_GotoDefinitionTarget[1]..phpactor#rpc:
line 6:
E121: Undefined variable: g:phpactorProjectRootPatterns
E116: Invalid arguments for function s:searchDirectoryUpwardForRootPatterns( fnamemodify(phpactor#_path(), ':h'), g:phpactorProjectRootPatterns, g:phpactorInitialCwd)
line 12:
E121: Undefined variable: g:phpactorPhpBin
line 14:
E121: Undefined variable: l:cmd
E116: Invalid arguments for function system(l:cmd, json_encode(request))
Error detected while processing function phpactor#GotoDefinition[1]..phpactor#_GotoDefinitionTarget[1]..phpactor#rpc:
line 20:
E605: Exception not caught: Could not parse response from Phpactor: Vim(let):E121: Undefined variable: result
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 23 (16 by maintainers)
@dantleech I guess moving variables to a plugin/phpactor.vim file would do the trick. Even if those things are loaded its’ not much, 10 lines maybe.
That works indeed, thanks! cc @kristijanhusak, this might be of some interest to you since phpactor is used as a good example of an optional package in the README of vim-packager.
No, the functions would still be available and we should keep it that way since they just got deprecated. I don’t how many version you want to wait until introducing a BC break.
From
:h <Plug>:A little bit clearer with
:h using-<Plug>:So the idea is that you create a mapping that will never conflict with any one, as long as the name is unique enough of course. Doing so the user just have to do:
We will have to check the recommendations for the parenthesis because you see plugins with and without them.
I think there is another factor here:
So that is now “deprecated” and everybody should ideally use the command equivalent,
:PhpactorGotoDefinition- which is only defined with the FT Plugin.The documentation now reflects this, but I guess lots of people are still using the functions directly…
OK, I think I managed to reproduce it with only phpactor as plugin on Vim
Could also be something to do with
Plug- as I think @greg0ire is using the native VIM package manager, and in the other issue the user was using Dein.Hi, on master or develop ? You got the error every time ? Others RPC call works as expected ? Have you try to turn vim off and on again ? 😃 (but seriously in case a previous action would have unset a variable or something)