Skip to content

Project Root Detection #660

Closed
Closed

Description

@gvanbeck

Lots of people have issues where they cd to a directory inside of VIM, but the working directory remains the same.

We should address this either in the VIM plugin or by using a strategy to detect the project root.

original issue below


just updated the development branch. When running phpactor#Status() I get the wrong working dir. My current working dir is where the .phpactor.yml file is. The 'Work dir' is pointing to my other project.
(I changed the foldernames for privacy)

Info

Version: dafc795 (12 hours ago) 657-completion-do-not-suggest-statics-non-statics-659
Work dir: /Users/myhomefolder/Documents/Other/Directory

Diagnostics

[✔] Composer detected - faster class location and more features!
[✔] Git detected - enables faster refactorings in your repository scope!
[✔] XDebug is disabled. XDebug has a negative effect on performance.

Config files

[✘] /Users/myhomefolder/.config/phpactor/phpactor.json
[✘] /Users/myhomefolder/.config/phpactor/phpactor.yml
[✘] /Users/myhomefolder/Documents/Current/.phpactor.json
[✔] /Users/myhomefolder/Documents/Current/.phpactor.yml

Activity

  1. dantleech commented on Dec 4, 2018

    @dantleech
    Collaborator

    The working dir should be based on the folder in which you started VIM, this hasn't changed as far as I'm aware.

    Can you confirm this is a regression (e.g. switching to 0.10.0 tag fixes the behavior?)

  2. gvanbeck commented on Dec 4, 2018

    @gvanbeck
    Author

    Switching to 0.10.0 did not fix it. After fiddling around I can confirm it was related to xolox/vim-session plugin. I changed the session though but the work dir still was wrong. Only closing of the session fixed it. I don't know if this can be usefull for you, if not just close this issue.

  3. dantleech commented on Dec 4, 2018

    @dantleech
    Collaborator

    yeah this is a known issue for a few people, currenty the working dir is set for the duration of the VIM process. I am open to adding project directory detection if it can be done sensibly.

  4. changed the title [-]working dir points to wrong directory[/-] [+]Project Root Detection[/+] on Dec 16, 2018
  5. fcojavierdomenech commented on Feb 19, 2019

    @fcojavierdomenech
    Contributor

    Just as a suggestion; I use vim-rooter and never had problems with that. Here is my config:

    "VIM-ROOTER
    "---------------------------------
    "what kind of files determine whether a directory is root
    Plug 'airblade/vim-rooter'
    let g:rooter_patterns = ['.git/','.phpactor.yml']
    au BufEnter * Rooter
    
    
  6. przepompownia commented on Mar 17, 2020

    @przepompownia
    Contributor

    Please test #923

  7. dantleech commented on Mar 30, 2020

    @dantleech
    Collaborator

    This has been implemented in develop, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions