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
Right, detecting by patterns that are present at the top of vendor packages does not make its job.
We have not available the third method: manual selecting the root of the project (the first method does it implicitly by setting current working directory before calling to phpactor). It's advantage is avoiding a situation like presented above. It has also drawback if it bases on one global variable per whole vim process in the case when we need to have work on more than one project.
Proposition: have more than one project root and assign each buffer handled by phpactor to exactly one of them. It implicitly would define "project" described only by its root at this moment. Probably assumptions:
for the first such buffer (in newly created project) we determine its root directory by one of mentioned method,
we define what belonging to the project means (e.g. buffer file path is under its project root directory) and if we open any file then we decide if it belongs to any existing project or we have to create the new project.
I have followed this subject from afar since it's a bit crazy at work currently.
However I wonder if it's a good idea to use the composer.json file since it will be present in most PHP projects (including the vendors).
If I'm not mistaken the .git directory is not created for the vendors, neither as it should be for monolithic projects with a gitsplit feature.
So it might be a better idea to rely on .git, .phpactor, .projections and forget about composer files.
If I'm not mistaken the .git directory is not created for the vendors
It is if you install dev versions.
I think @przepompownia 's suggestion of assuming the project root to be the (resolved) directory of the first opened buffer, then switch if opening a buffer outside of that root makes sense (and seems to be the same as CoC
If I'm not mistaken the .git directory is not created for the vendors
It is if you install dev versions.
I'm surprised because I have a composer.json with a require-dev including "phpunit/phpunit": "^9.0@dev" and not .git folder in vendor/phpunit/phpunit
You only need git when you intent to commit, when installing a dependency with composer you usually dont so it make sense to me that composer clone in a way that ignore the .git directory.
But no matter at the end because I could also use a path repository and have a vendor which is actually a simlink to a project with the .git directory...
I do that a lot with phpactor packages :D
I think @przepompownia 's suggestion of assuming the project root to be the (resolved) directory of the first opened buffer, then switch if opening a buffer outside of that root makes sense (and seems to be the same as CoC
It make sense if we are dealing with it inside vim.
But I thought the idea was that the client will ask to the server to gave him the root directory for a file.
But again I followed from really far so I might not have understood something, but if that's the case then the server should be not be concerned by where the client was on the last call to this method.
Right, usually fetching VCS index does not make sense, but sometines it is very practical. Phpactor itself is a good example. Sometimes I want to test a changes in some subproject that are not yet available for whole phpactor project because of constraints from composer.lock or when I would like to use custom changes.
Activity
przepompownia commentedon Apr 6, 2020
Right, detecting by patterns that are present at the top of vendor packages does not make its job.
We have not available the third method: manual selecting the root of the project (the first method does it implicitly by setting current working directory before calling to phpactor). It's advantage is avoiding a situation like presented above. It has also drawback if it bases on one global variable per whole vim process in the case when we need to have work on more than one project.
Proposition: have more than one project root and assign each buffer handled by phpactor to exactly one of them. It implicitly would define "project" described only by its root at this moment. Probably assumptions:
dantleech commentedon Apr 6, 2020
Sounds similar to https://github.com/neoclide/coc.nvim/wiki/Using-workspaceFolders
camilledejoye commentedon Apr 8, 2020
I have followed this subject from afar since it's a bit crazy at work currently.
However I wonder if it's a good idea to use the
composer.jsonfile since it will be present in most PHP projects (including the vendors).If I'm not mistaken the
.gitdirectory is not created for the vendors, neither as it should be for monolithic projects with a gitsplit feature.So it might be a better idea to rely on
.git,.phpactor,.projectionsand forget about composer files.dantleech commentedon Apr 8, 2020
It is if you install dev versions.
I think @przepompownia 's suggestion of assuming the project root to be the (resolved) directory of the first opened buffer, then switch if opening a buffer outside of that root makes sense (and seems to be the same as CoC
What is
.projections? 🤔camilledejoye commentedon Apr 8, 2020
I might have misspelled it, it came form https://github.com/tpope/vim-projectionist
I'm surprised because I have a composer.json with a
require-devincluding"phpunit/phpunit": "^9.0@dev"and not.gitfolder invendor/phpunit/phpunitYou only need git when you intent to commit, when installing a dependency with composer you usually dont so it make sense to me that composer clone in a way that ignore the
.gitdirectory.But no matter at the end because I could also use a
pathrepository and have a vendor which is actually a simlink to a project with the.gitdirectory...I do that a lot with phpactor packages :D
It make sense if we are dealing with it inside vim.
But I thought the idea was that the client will ask to the server to gave him the root directory for a file.
But again I followed from really far so I might not have understood something, but if that's the case then the server should be not be concerned by where the client was on the last call to this method.
dantleech commentedon Apr 9, 2020
I don't think that was the idea - (in the context of RPC) Phpactor has no state, so can't decide what the project root should be
przepompownia commentedon Apr 11, 2020
@elythyr try
--prefer-sourceor its config equivalent.Right, usually fetching VCS index does not make sense, but sometines it is very practical. Phpactor itself is a good example. Sometimes I want to test a changes in some subproject that are not yet available for whole phpactor project because of constraints from composer.lock or when I would like to use custom changes.
dantleech commentedon Apr 12, 2020
Might also be good to be able to explicitly request the CWD to be re-calculated (e.g. when working in a vendor dependency for Phpactor)
przepompownia commentedon Apr 13, 2020
@dantleech @elythyr please look at and test the early implementation of the idea described above: #959