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
Oddly, the language server doesn't start in the latest LanguageClient-neovim versions if I use that repo to set serverCommands, but if I manually hardcode g:LanguageClient_serverCommands it works
g:LanguageClient_serverStderr was set for --language-server-verbose to get logged to a file while debugging this, it's extremely verbose.
(unrelatedly, this works better when pcntl is available in php -m. The language server is throwing exceptions in some edge cases when pcntl is unavailable and LanguageClient-neovim doesn't indicate this - I fixed that in github.com/phan/phan v4 just now)
Expected behavior
registerServerCommands should work as expected. Modified file contents should get sent to language server if a language server is registered through LanguageClient_registerServerCommand
Additional context
I haven't updated the client in a while, but the server worked on old releases.
If I call LanguageClientStart with the plugin as-is, calling registerServerCommands, the client stops sending commands after the s:SetHighlights line.
If I hardcode the exact same command line the plugin would generate, then the client works as expected
13:27:41 INFO unnamed src/vim.rs:225 Begin setqflist
13:27:41 DEBUG writer-None src/rpcclient.rs:256 => None {"jsonrpc":"2.0","method":"setqflist","params":[[{"col":1,"filename":"/home/tyson/programming/phan/src/Phan/Config.php","lnum":7,"nr":null,"text":"PhanNativePHPSyntaxCheckPlugin Saw error or notice for /home/tyson/php-7.2.34-nts-install/bin/php --syntax-check: \"Parse error: syntax error, unexpected 'Phan' (T_STRING)\"","type":"E"},{"col":1,"filename":"/home/tyson/programming/phan/src/Phan/Config.php","lnum":7,"nr":null,"text":"PhanNoopConstant Unused constant","type":"I"},{"col":1,"filename":"/home/tyson/programming/phan/src/Phan/Config.php","lnum":7,"nr":null,"text":"PhanPluginNotFullyQualifiedGlobalConstant Expected usage of Phan\\Config\\Initializer to be fully qualified or have a use statement but none were found in namespace \\Phan","type":"W"},{"col":1,"filename":"/home/tyson/programming/phan/src/Phan/Config.php","lnum":7,"nr":null,"text":"PhanPluginNotFullyQualifiedGlobalConstant Expected usage of se to be fully qualified or have a use statement but none were found in namespace \\Phan","type":"W"},{"col":4,"filename":"/home/tyson/programming/phan/src/Phan/Config.php","lnum":7,"nr":null,"text":"PhanSyntaxError syntax error, unexpected 'Phan' (T_STRING)","type":"E"},{"col":1,"filename":"/home/tyson/programming/phan/src/Phan/Config.php","lnum":7,"nr":null,"text":"PhanUndeclaredConstant Reference to undeclared constant \\Phan\\Phan\\Config\\Initializer. This will cause a thrown Error in php 8.0+.","type":"E"},{"col":1,"filename":"/home/tyson/programming/phan/src/Phan/Config.php","lnum":7,"nr":null,"text":"PhanUndeclaredConstant Reference to undeclared constant \\se. This will cause a thrown Error in php 8.0+.","type":"E"},{"col":1,"filename":"/home/tyson/programming/phan/src/Phan/Config.php","lnum":1306,"nr":null,"text":"PhanUndeclaredClassMethod Call to method determineTargetPHPVersion from undeclared class \\Phan\\Initializer (Did you mean class \\Phan\\Config\\Initializer)","type":"E"}],"r"]}
13:27:41 DEBUG writer-None src/rpcclient.rs:256 => None {"jsonrpc":"2.0","method":"setqflist","params":[[],"a",{"title":"[LC]: diagnostics"}]}
13:27:41 DEBUG writer-None src/rpcclient.rs:256 => None {"jsonrpc":"2.0","method":"eval","params":["bufnr('/home/tyson/programming/phan/src/Phan/Config.php')"],"id":26}
13:27:41 DEBUG reader-None src/rpcclient.rs:209 <= None {"id":26,"jsonrpc":"2.0","result":1}
13:27:41 DEBUG writer-None src/rpcclient.rs:256 => None {"jsonrpc":"2.0","method":"setbufvar","params":["/home/tyson/programming/phan/src/Phan/Config.php","LanguageClient_statusLineDiagnosticsCounts",{"E":5,"H":0,"I":1,"W":2}]}
13:27:41 DEBUG writer-None src/rpcclient.rs:256 => None {"jsonrpc":"2.0","method":"eval","params":["LSP#filename()"],"id":27}
13:27:41 DEBUG reader-None src/rpcclient.rs:209 <= None {"id":27,"jsonrpc":"2.0","result":"/home/tyson/programming/phan/src/Phan/Config.php"}
13:27:41 DEBUG unnamed src/language_client.rs:158 state.highlights./home/tyson/programming/phan/src/Phan/Config.php: [] ==> [{"character_end":0,"character_start":0,"group":"LanguageClientInfo","line":6,"text":""},{"character_end":0,"character_start":0,"group":"LanguageClientWarning","line":6,"text":""},{"character_end":0,"character_start":0,"group":"LanguageClientWarning","line":6,"text":""},{"character_end":0,"character_start":0,"group":"LanguageClientError","line":6,"text":""},{"character_end":0,"character_start":3,"group":"LanguageClientError","line":6,"text":""},{"character_end":0,"character_start":0,"group":"LanguageClientError","line":6,"text":""},{"character_end":0,"character_start":0,"group":"LanguageClientError","line":6,"text":""},{"character_end":0,"character_start":0,"group":"LanguageClientError","line":1305,"text":""}]
13:27:41 DEBUG writer-None src/rpcclient.rs:256 => None {"jsonrpc":"2.0","method":"s:MatchDelete","params":[[]]}
13:27:41 DEBUG writer-None src/rpcclient.rs:256 => None {"jsonrpc":"2.0","method":"matchaddpos","params":["LanguageClientInfo",[[7,1,999999]]],"id":28}
13:27:41 DEBUG reader-None src/rpcclient.rs:209 <= None {"id":28,"jsonrpc":"2.0","result":7}
13:27:41 DEBUG writer-None src/rpcclient.rs:256 => None {"jsonrpc":"2.0","method":"matchaddpos","params":["LanguageClientError",[[7,1,999999],[7,4,999999],[7,1,999999],[7,1,999999],[1306,1,999999]]],"id":29}
13:27:41 DEBUG reader-None src/rpcclient.rs:209 <= None {"id":29,"jsonrpc":"2.0","result":8}
13:27:41 DEBUG writer-None src/rpcclient.rs:256 => None {"jsonrpc":"2.0","method":"matchaddpos","params":["LanguageClientWarning",[[7,1,999999],[7,1,999999]]],"id":30}
13:27:41 DEBUG reader-None src/rpcclient.rs:209 <= None {"id":30,"jsonrpc":"2.0","result":9}
13:27:41 DEBUG unnamed src/language_client.rs:158 state.highlight_match_ids: [] ==> [7,8,9]
13:27:41 INFO unnamed src/language_client.rs:1604 handle_cursor_moved; params=Null force_redraw=true
13:27:41 DEBUG writer-None src/rpcclient.rs:256 => None {"jsonrpc":"2.0","method":"eval","params":["LSP#filename()"],"id":31}
13:27:41 DEBUG reader-None src/rpcclient.rs:209 <= None {"id":31,"jsonrpc":"2.0","result":"/home/tyson/programming/phan/src/Phan/Config.php"}
13:27:41 DEBUG writer-None src/rpcclient.rs:256 => None {"jsonrpc":"2.0","method":"getbufvar","params":["/home/tyson/programming/phan/src/Phan/Config.php","&filetype"],"id":32}
13:27:41 DEBUG reader-None src/rpcclient.rs:209 <= None {"id":32,"jsonrpc":"2.0","result":"php"}
13:27:41 DEBUG writer-None src/rpcclient.rs:256 => None {"jsonrpc":"2.0","method":"eval","params":["LSP#position()"],"id":33}
13:27:41 DEBUG reader-None src/rpcclient.rs:209 <= None {"id":33,"jsonrpc":"2.0","result":{"character":0,"line":6}}
13:27:41 DEBUG writer-None src/rpcclient.rs:256 => None {"jsonrpc":"2.0","method":"eval","params":["LSP#viewport()"],"id":34}
13:27:41 DEBUG reader-None src/rpcclient.rs:209 <= None {"id":34,"jsonrpc":"2.0","result":{"end":18,"start":0}}
13:27:41 INFO unnamed src/language_client.rs:1569 get_signs_to_display; filename="/home/tyson/programming/phan/src/Phan/Config.php" viewport=Viewport { start: 0, end: 18 }
13:27:41 DEBUG writer-None src/rpcclient.rs:256 => None {"jsonrpc":"2.0","method":"s:set_signs","params":["/home/tyson/programming/phan/src/Phan/Config.php",[{"id":75025,"line":6,"name":"LanguageClientError"}]],"id":35}
13:27:41 DEBUG reader-None src/rpcclient.rs:209 <= None {"id":35,"jsonrpc":"2.0","result":0}
13:27:41 DEBUG writer-None src/rpcclient.rs:256 => None {"jsonrpc":"2.0","method":"s:SetHighlights","params":[[{"character_end":0,"character_start":0,"group":"LanguageClientInfo","line":6,"text":""},{"character_end":0,"character_start":0,"group":"LanguageClientWarning","line":6,"text":""},{"character_end":0,"character_start":0,"group":"LanguageClientWarning","line":6,"text":""},{"character_end":0,"character_start":0,"group":"LanguageClientError","line":6,"text":""},{"character_end":0,"character_start":3,"group":"LanguageClientError","line":6,"text":""},{"character_end":0,"character_start":0,"group":"LanguageClientError","line":6,"text":""},{"character_end":0,"character_start":0,"group":"LanguageClientError","line":6,"text":""}],"__LCN_DIAGNOSTIC_HIGHLIGHT__"]}
13:27:41 DEBUG writer-None src/rpcclient.rs:256 => None {"jsonrpc":"2.0","method":"s:ExecuteAutocmd","params":["LanguageClientDiagnosticsChanged"]}
The text was updated successfully, but these errors were encountered:
TysonAndre
added a commit
to TysonAndre/LanguageServer-phan-neovim
that referenced
this issue
May 22, 2021
Ah good catch! I think this should be easy to solve by just adding a value for the missing registered server on the call to LanguageClient#registerServerCommands if there is nothing else configured. Will try and think if there's a simplest solution to this in the next few days but I think that will most likely be the solution.
bin/languageclient --version
to get its version number. 0.1.161:checkhealth LanguageClient
? N/ADescribe the bug
LanguageClient_registerServerCommands
no longer works without a key in theg:LanguageClient_serverCommands
config,I'm seeing
Server not configured for filetype php
after updating this to the latest public release.LanguageClient#registerServerCommands calls LanguageClient#Call
LanguageClient#Call will filter out messages to skip.
One of the reasons a message could be skipped is that there is no serverCommand configured for that language.
However, LanguageClient#registerServerCommands is what is used to add language server commands
I expect this was caused by "Do not send requests/notifications for buffers without a configured server command (#1121) "
I assume that
.vim/settings.json
is now recommended instead?I still get issues even with this patch - file updates aren't sent to the language server if I use the plugin rather than hardcoding serverCommands
Environment
nvim --version
orvim --version
): vim 8.2git rev-parse --short HEAD
):1cb8bb5
bin/languageclient --version
): 0.1.161reproduce the issue. Refer to an example here): missing
To Reproduce
Current behavior
Server not configured for filetype php
is seen with https://github.com/TysonAndre/LanguageServer-phan-neovimOddly, the language server doesn't start in the latest LanguageClient-neovim versions if I use that repo to set serverCommands, but if I manually hardcode g:LanguageClient_serverCommands it works
g:LanguageClient_serverStderr
was set for--language-server-verbose
to get logged to a file while debugging this, it's extremely verbose.(unrelatedly, this works better when
pcntl
is available inphp -m
. The language server is throwing exceptions in some edge cases when pcntl is unavailable and LanguageClient-neovim doesn't indicate this - I fixed that in github.com/phan/phanv4
just now)Expected behavior
registerServerCommands should work as expected. Modified file contents should get sent to language server if a language server is registered through LanguageClient_registerServerCommand
Additional context
I haven't updated the client in a while, but the server worked on old releases.
If I call LanguageClientStart with the plugin as-is, calling registerServerCommands, the client stops sending commands after the
s:SetHighlights
line.If I hardcode the exact same command line the plugin would generate, then the client works as expected
The text was updated successfully, but these errors were encountered: