Skip to content

[BC] Detection of "root directory" create BC breaks and can't be disabled #985

@camilledejoye

Description

@camilledejoye

let request = { "action": a:action, "parameters": a:arguments }
let l:workspaceDir = s:searchDirectoryUpwardForRootPatterns(
\ fnamemodify(phpactor#_path(), ':h'),
\ g:phpactorProjectRootPatterns,
\ g:phpactorInitialCwd
\)

That's bad!
I didn't looked too much as #923 because I didn't saw the point, not that there is none but I work with noautochdir and my Vim always start at the root of my project.

But I just updated my work environment to test LSP in real conditions, since yesterday I can't complete classes, import them, etc

We need to be a bit more careful about BC breaks I guess, on develop it's kind of acceptable.
But this will be a MASSIVE change IMO that needs to be clearly mentioned in the changelog.

Even better would be to make it configurable, I wonder if we could look at the autochdir option and disable that improvement if the option is off.
My problem with that right know, is that phpactor behave as if I was in a directory that I'm actually not in!

The worse thing is that I can't actually disable the auto-detection !!!
I need to cheet and add let g:phpactorProjectRootPatterns = [] to my vimrc, but it's really a hack because I don't need anything to be done since the directory will never change.
Now on each RPC request made, the vim plugin will loop over all parent directories of my pwd until it reaches my home directory and then fallback to the value I want from the start.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions