Add a button to restart the LSP Client.

This commit is contained in:
Martín Lucas Golini
2023-11-03 01:52:27 -03:00
parent 7f2d9bc093
commit 1bf41714f8

View File

@@ -897,7 +897,8 @@ void LSPClientPlugin::loadLSPConfig( std::vector<LSPDefinition>& lsps, const std
"lsp-symbol-code-action",
"lsp-rename-symbol-under-cursor",
"lsp-refresh-semantic-highlighting",
"lsp-format-range" };
"lsp-format-range",
"lsp-plugin-reload" };
for ( const auto& key : list ) {
if ( kb.contains( key ) ) {
if ( !kb[key].empty() )
@@ -1201,6 +1202,8 @@ void LSPClientPlugin::onRegister( UICodeEditor* editor ) {
mClientManager.rangeFormatting(
static_cast<UICodeEditor*>( client )->getDocumentRef() );
} );
doc.setCommand( "lsp-plugin-reload", [this] { mManager->reload( getId() ); } );
}
std::vector<Uint32> listeners;
@@ -1370,6 +1373,8 @@ bool LSPClientPlugin::onCreateContextMenu( UICodeEditor* editor, UIPopUpMenu* me
if ( server->getDefinition().language == "cpp" || server->getDefinition().language == "c" )
addFn( "lsp-switch-header-source", "Switch Header/Source", "filetype-hpp" );
addFn( "lsp-plugin-reload", "LSP Client Reload", "refresh" );
#ifdef EE_DEBUG
if ( server->getDefinition().name == "clangd" )
addFn( "lsp-memory-usage", "LSP Memory Usage" );