You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BC] Detection of "root directory" create BC breaks and can't be disabled #985
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.
OK I will check it again then, make sure that we can disable it entirely and not just tweak the all thing.
Personally I see this feature as optional, if you want auto-detection activate it.
Otherwise we just use the vim pwd, I guess any plugins that deal with projects inside vim (there is multiple already that do all that) will change the current directory per buffer.
So we should default the current directory, allowing other plugins to do their job and provide the correct path if needed.
And only on last resort, because of the user will we offer a detection system.
The problem is that plugins change the CWD and people expect Phpactor to work in the new CWD, but as the CWD can be in a random directory and not necessarily the project root, Phpactor would need to detect the project root.
I think @przepompownia 's new PR will only offer to change it's CWD if it is on a different branch of the filesystem, so then you wouldn't be prompted (and the CWD wouldn't be detected) until you open a new project.
Currently the new PR allows working workspace root detection as before #923 (with let g:phpactorNoninteractiveProjectResolvers = [] in user settings tht can be chaned as the default). It also allows disable user prompt (by default).
Lack of my free time slows down making fixes, refactor and responding to comments. This PR still does not uses the result (i.e. it does not override l:workspaceDir by b:phpactorProject.primaryRootPath).
Shortly: determining root by CWD and by root markers are not usable in some cases. PR #959 tries to resolve it.
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.
It is bad, you are right. With #959 after using b:phpactorProject.primaryRootPath there would no recalculation the root path with each RPC request.
Activity
dantleech commentedon Apr 28, 2020
Yes, I did that too. We should set to
[]by default for now (or revert, but that might cause conflicts)It would be replaced by #959 @przepompownia
camilledejoye commentedon Apr 28, 2020
OK I will check it again then, make sure that we can disable it entirely and not just tweak the all thing.
Personally I see this feature as optional, if you want auto-detection activate it.
Otherwise we just use the vim pwd, I guess any plugins that deal with projects inside vim (there is multiple already that do all that) will change the current directory per buffer.
So we should default the current directory, allowing other plugins to do their job and provide the correct path if needed.
And only on last resort, because of the user will we offer a detection system.
I don't know if that make sense or not...
dantleech commentedon Apr 28, 2020
The problem is that plugins change the CWD and people expect Phpactor to work in the new CWD, but as the CWD can be in a random directory and not necessarily the project root, Phpactor would need to detect the project root.
I think @przepompownia 's new PR will only offer to change it's CWD if it is on a different branch of the filesystem, so then you wouldn't be prompted (and the CWD wouldn't be detected) until you open a new project.
przepompownia commentedon Apr 28, 2020
Currently the new PR allows working workspace root detection as before #923 (with
let g:phpactorNoninteractiveProjectResolvers = []in user settings tht can be chaned as the default). It also allows disable user prompt (by default).Lack of my free time slows down making fixes, refactor and responding to comments. This PR still does not uses the result (i.e. it does not override
l:workspaceDirbyb:phpactorProject.primaryRootPath).Shortly: determining root by CWD and by root markers are not usable in some cases. PR #959 tries to resolve it.
przepompownia commentedon Apr 28, 2020
It is bad, you are right. With #959 after using
b:phpactorProject.primaryRootPaththere would no recalculation the root path with each RPC request.przepompownia commentedon Apr 28, 2020
In cc700e9 recalculation with
s:searchDirectoryUpwardForRootPatterns()was dropped in favor to useb:phpactorProject.primaryRootPath.dantleech commentedon May 3, 2020
This feature has now been removed from develop, but let's push it into the next release :) #1001