Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion autoload/phpactor.vim
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,12 @@ endfunction

function! phpactor#Status()
if exists(':terminal')
let l:cmd = g:phpactorPhpBin . ' ' . g:phpactorbinpath . ' status'
let l:workspaceDir = phpactor#getRootDirectory()

" note that we should escape these arguments, but using the list syntax
" here causes tests to fail on travis with VIM 8.3 ...
let l:cmd = g:phpactorPhpBin . ' ' . g:phpactorbinpath . ' status --working-dir=' . l:workspaceDir

if has('nvim')
execute 'split term://' . l:cmd
" Press any key to leave
Expand Down
12 changes: 8 additions & 4 deletions lib/Phpactor.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,19 @@ public static function boot(InputInterface $input, string $vendorDir): Container
{
$config = [];

$cwd = getcwd();
$projectRoot = getcwd();

if ($input->hasParameterOption([ '--working-dir', '-d' ])) {
$projectRoot = $input->getParameterOption([ '--working-dir', '-d' ]);
}

$loader = ConfigLoaderBuilder::create()
->enableJsonDeserializer('json')
->enableYamlDeserializer('yaml')
->addXdgCandidate('phpactor', 'phpactor.json', 'json')
->addXdgCandidate('phpactor', 'phpactor.yml', 'yaml')
->addCandidate($cwd . '/.phpactor.json', 'json')
->addCandidate($cwd . '/.phpactor.yml', 'yaml')
->addCandidate($projectRoot . '/.phpactor.json', 'json')
->addCandidate($projectRoot . '/.phpactor.yml', 'yaml')
->loader();

$config = $loader->load();
Expand All @@ -82,7 +86,7 @@ public static function boot(InputInterface $input, string $vendorDir): Container
$config = self::configureLanguageServer($config);

if ($input->hasParameterOption([ '--working-dir', '-d' ])) {
$config[FilePathResolverExtension::PARAM_PROJECT_ROOT] = $cwd = $input->getParameterOption([ '--working-dir', '-d' ]);
$config[FilePathResolverExtension::PARAM_PROJECT_ROOT] = $projectRoot;
}

if (!isset($config[CoreExtension::PARAM_XDEBUG_DISABLE]) || $config[CoreExtension::PARAM_XDEBUG_DISABLE]) {
Expand Down