Open vendion opened 2 years ago
hm, as far as CoC or other LSP clients are concerned Phpactor is agnostic to the VIM version. Does it work in Neovim?
you coud enable logging in Phpactor to see if it's getting any requests: https://phpactor.readthedocs.io/en/master/other/developing.html
I don't have Neovim installed or even configured, but I did enable logging and it does seem to be getting requests from CoC.
hm I don't see any requests in that log, looks like it's just indexing....
Okay let's try this one including a screenshot showing that CoC is requesting hover information:
I do know that CoC works, as I have no problem with the Go, Vim, Perl, Elvish language servers and even coc-phpls (using Intelephense) works with this same project (would just rather use an open source solution and Phpactor looks like the better option).
ah, may be you need to enable trace: https://phpactor.readthedocs.io/en/master/reference/configuration.html#language-server-trace
then grep for TRAC
Doing so I see tho following line in the log:
[2022-07-14 17:16:37] phpactor.INFO: TRAC << {"jsonrpc":"2.0","id":"dea8fe25-03cd-41ff-94f4-8b86ad4e3a2c","result":null} {"channel":"LSP","jsonrpc":"2.0","id":"dea8fe25-03cd-41ff-94f4-8b86ad4e3a2c","result":null,"error":null} []
[2022-07-14 17:16:38] phpactor.INFO: TRAC >> {"jsonrpc":"2.0","id":1,"method":"textDocument\/codeAction","params":{"textDocu⋯ {"channel":"LSP","jsonrpc":"2.0","id":1,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///home/vendion/work/Juice4-STS6/juice-myaccount.php"},"range":{"start":{"line":467,"character":22},"end":{"line":467,"character":22}},"context":{"diagnostics":[]}}} []
ok, not sure if it's interesting but it's using a UUID for the response for the first request, and the second request is issuing (from the client and ID of 1). Will try CoC with Neovim (which I used for years before switching to the native LSP client) else maybe it's somehow a difference with CoC and VIM 9 that Phpactor doesn't handle properly.
Can confirm that Phpactor + CoC + Neovim work so maybe a complication with vim 9 :/
I am actually using Vim 9 with coc and phpactor and I didn't notice any particular issue.
hm, running in Windows by the looks of the screenshot? On WSL? Wonder if that complicates it somehow (Phpactor is not compatible with Windows AFAIK, but I guess it runs on WSL)
@vendion's screenshot seems from KDE. I am using Xubuntu and all is working correctly!
oh well, i seem to be not up to date on either Windows or KDE :smile:
I am indeed using KDE using Arch Linux as my distribution.
Just to clarify is there anything special that needs to be set in coc-settings.json apart from phpactor.enable
and phpactor.path
?
Here is what I have in mine
{
"languageserver": {
"ccls": {
"command": "ccls",
"filetypes": ["c", "cc", "cpp", "c++", "objc", "objcpp"],
"rootPatterns": [".ccls", "compile_commands.json", ".git/", ".hg/"],
"initializationOptions": {
"cache": {
"directory": "/tmp/ccls"
}
}
},
"elvish": {
"command": "elvish",
"args": ["-lsp"],
"filetypes": ["elvish"],
"rootPatterns": [".elv"]
}
},
"intelephense.licenceKey": "(redacted)",
"diagnostic.displayByAle": true,
"phpls.enable": false,
"phpactor.enable": true,
"phpactor.path": "$HOME/.vim/plugged/phpactor/bin/phpactor",
"Lua.telemetry.enable": true
}
my setup is a ltittle different, but not sure it would make a diff:
{
"coc.source.around.enable":false,
"coc.source.buffer.enable":false,
"coc.source.file.enable":true,
"coc.preferences.enableFloatHighlight":true,
"coc.preferences.currentFunctionSymbolAutoUpdate":true,
"phpactor.enable": true,
"phpactor.path": "phpactor",
"phpactor.debug": true,
"phpactor.revealOutputChannelOn":"warn",
"coc.preferences.enableMessageDialog":false,
"phpactor.trace.server":"error",
"suggest.floatEnable": false,
"phpactor.config": {
"logging.level": "error",
"logging.enabled": true,
"logging.path": "/home/daniel/www/phpactor/phpactor-session.log",
"language_server.diagnostic_sleep_time": 1000,
"language_server.diagnostics_on_update": false,
"language_server_completion.trim_leading_dollar": false,
"language_server_phpstan.level": 7,
"language_server_phpstan.enabled": false
},
"diagnostic.virtualText":false,
"diagnostic.enableSign": true,
"diagnostic.maxWindowHeight":100,
"diagnostic.maxWindowWidth":500,
"coc.preferences.useQuickfixForLocations":true
}
I thought I had it figured out, as I opened a different project, one that is built on Laravel, and phpactor worked there so I thought it was just an issue between that project and phpactor.
What caused me to have doubts is I recently setup neovim + native LSP and phpactor is working without any issues in both projects. :shrug:
I'm trying to get
Phpactor
andcoc-phpactor
setup under Vim 9, I have the vim plugin andphpactor
itself installed as well as havecoc-phpactor
installed and enabled.The problem is it seems that Coc.nvim isn't able to talk to
phpactor
, what I mean by this is things like:CocCommand phpactor.status
,:CocCommand phpactor.reindex
,:CocCommand phpactor.services.list
generate no output when ran, there is no code completion offered, and things like Hover and GoTo Definiton just hang forever.Output of
:CocInfo
Output of
:PhpactorStatus