mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-07-14 15:02:50 +03:00
Display signature help if avialable and not symbol info is available when pressing lsp-symbol-info (F1).
This commit is contained in:
@@ -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