mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-18 06:55:48 +03:00
Display signature help if avialable and not symbol info is available when pressing lsp-symbol-info (F1).
This commit is contained in:
@@ -784,6 +784,11 @@ PluginRequestHandle AutoCompletePlugin::processResponse( const PluginMessage& ms
|
||||
}
|
||||
}
|
||||
return processCodeCompletion( msg.asCodeCompletion() );
|
||||
} else if ( msg.isRequest() && msg.type == PluginMessageType::SignatureHelp ) {
|
||||
if ( getManager() && getManager()->getSplitter() &&
|
||||
getManager()->getSplitter()->curEditorIsNotNull() ) {
|
||||
requestSignatureHelp( getManager()->getSplitter()->getCurEditor() );
|
||||
}
|
||||
} else if ( msg.isResponse() && msg.type == PluginMessageType::SignatureHelp ) {
|
||||
return processSignatureHelp( msg.asSignatureHelp() );
|
||||
} else if ( msg.isBroadcast() && msg.type == PluginMessageType::LanguageServerCapabilities ) {
|
||||
|
||||
@@ -27,6 +27,15 @@ namespace ecode {
|
||||
#define LSPCLIENT_THREADED 0
|
||||
#endif
|
||||
|
||||
static json getURIAndPositionJSON( UICodeEditor* editor ) {
|
||||
json data;
|
||||
auto doc = editor->getDocumentRef();
|
||||
auto sel = doc->getSelection();
|
||||
data["uri"] = doc->getURI().toString();
|
||||
data["position"] = { { "line", sel.start().line() }, { "character", sel.start().column() } };
|
||||
return data;
|
||||
}
|
||||
|
||||
class LSPLocationModel : public Model {
|
||||
public:
|
||||
enum CustomInfo { URI, TextRange };
|
||||
@@ -1386,6 +1395,10 @@ void LSPClientPlugin::getSymbolInfo( UICodeEditor* editor ) {
|
||||
editor->getScreenPosition( editor->getDocument().getSelection().start() )
|
||||
.getPosition() );
|
||||
} );
|
||||
} else {
|
||||
json data = getURIAndPositionJSON( editor );
|
||||
mManager->sendRequest( PluginMessageType::SignatureHelp, PluginMessageFormat::JSON,
|
||||
&data );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user