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
I use <Leader>ca to calculate the code actions for the entire document. It will offer to "fix" various things (note this currently only works in develop ), if there are missing classes it will offer to import them.
In addition, classes should be imported automatically when you select them from the auto-complete.
I did notice that there was a PR that mentioned it auto importing but that didnt work for me.
After some further investigation it seems to be due to me having remapped the keys for the pop up menu.
I don't think we should gave too much information about how to configure a client, otherwise the burden of maintaining this information will be on us.
Maybe we can instead add links to relevant parts in the clients documentation, even then if the links are dead we will have to maintain them.
@dantleech up to you, if you want I will do a PR to add the above links, otherwise I think we can close the issue.
But it's not clear that you need code-actions in order to import classes, etc.
code-action short cuts should be added to the example CoC configuration (or we can remove it in favor of a link to CoC, but the Phpactor example is a lot less daunting)
There should be documentation on the currently available code-actions (import class, implement contracts etc) and diagnostics - and we should hyperlink to these from the lsp-support page.
Activity
dantleech commentedon Oct 27, 2020
code actions, for example
I use
<Leader>cato calculate the code actions for the entire document. It will offer to "fix" various things (note this currently only works indevelop), if there are missing classes it will offer to import them.In addition, classes should be imported automatically when you select them from the auto-complete.
indeedhat commentedon Oct 27, 2020
Thanks, the code action works perfectly.
I did notice that there was a PR that mentioned it auto importing but that didnt work for me.
After some further investigation it seems to be due to me having remapped the keys for the pop up menu.
dantleech commentedon Oct 27, 2020
Then I guess this ticket should be re-purposed to updating the support document to link to the relevant sections of the doc (if they exist)
indeedhat commentedon Oct 27, 2020
i tried greping the project and i don't think that they do
camilledejoye commentedon Oct 31, 2020
For CoC:
I don't think we should gave too much information about how to configure a client, otherwise the burden of maintaining this information will be on us.
Maybe we can instead add links to relevant parts in the clients documentation, even then if the links are dead we will have to maintain them.
@dantleech up to you, if you want I will do a PR to add the above links, otherwise I think we can close the issue.
dantleech commentedon Oct 31, 2020
But it's not clear that you need code-actions in order to import classes, etc.
code-actionshort cuts should be added to the example CoC configuration (or we can remove it in favor of a link to CoC, but the Phpactor example is a lot less daunting)lsp-supportpage.camilledejoye commentedon Oct 31, 2020
I agree a list of available code actions would be nice.
I will try to do it and add it in the LSP support page.
For the doc I will update the CoC configuration we have to add links.
dantleech commentedon Oct 31, 2020
Probably better as a separate page -
lsp/code-actions.rstor similar, with links as necessary from the support page.camilledejoye commentedon Nov 1, 2020
@dantleech I think we can close it.
dantleech commentedon Nov 2, 2020
Thanks, I updated to link to the new page from the lsp-support page.