mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-18 06:55:48 +03:00
ecode: LSP - Don't fork a new process if the binary isn't available on the file system. Don't process notifications without method. Fix feature detection on initialize response when the server explicitly returns false for a feature.
This commit is contained in:
@@ -294,7 +294,8 @@ static void fromJson( LSPServerCapabilities& caps, const json& json ) {
|
||||
// so consider an object there as a (good?) sign that the server is suitably capable
|
||||
auto toBoolOrObject = []( const nlohmann::json& value, const std::string& valueName ) {
|
||||
return value.contains( valueName ) &&
|
||||
( value[valueName].is_boolean() || value[valueName].is_object() );
|
||||
( ( value[valueName].is_boolean() && value.value( valueName, false ) ) ||
|
||||
value[valueName].is_object() );
|
||||
};
|
||||
|
||||
auto& sync = json["textDocumentSync"];
|
||||
@@ -1404,6 +1405,11 @@ void LSPClientServer::workDoneProgress( const LSPWorkDoneProgressParams& workDon
|
||||
}
|
||||
|
||||
void LSPClientServer::processNotification( const json& msg ) {
|
||||
if ( !msg.contains( MEMBER_METHOD ) ) {
|
||||
Log::info( "LSPClientServer::processNotification - Unexpected notification, msg: %s",
|
||||
msg.dump().c_str() );
|
||||
return;
|
||||
}
|
||||
auto method = msg[MEMBER_METHOD].get<std::string>();
|
||||
if ( method == "textDocument/publishDiagnostics" ) {
|
||||
publishDiagnostics( msg );
|
||||
@@ -1555,8 +1561,8 @@ void LSPClientServer::readStdOut( const char* bytes, size_t n ) {
|
||||
Log::debug( "LSPClientServer::readStdOut server %s said:\n%s", mLSP.name.c_str(),
|
||||
res.dump().c_str() );
|
||||
|
||||
HandlersMap::iterator it = mHandlers.end();
|
||||
HandlersMap::iterator itEnd = mHandlers.end();
|
||||
HandlersMap::iterator it;
|
||||
HandlersMap::iterator itEnd;
|
||||
JsonReplyHandler handlerOK;
|
||||
JsonReplyHandler handlerErr;
|
||||
bool handlerFound = false;
|
||||
|
||||
Reference in New Issue
Block a user