MCPcopy Create free account
hub / github.com/SpartanJ/eepp / onRegister

Method onRegister

src/tools/ecode/plugins/lsp/lspclientplugin.cpp:1395–1516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1393}
1394
1395void LSPClientPlugin::onRegister( UICodeEditor* editor ) {
1396 Lock l( mDocMutex );
1397 mDocs.insert( editor->getDocumentRef().get() );
1398
1399 for ( auto& kb : mKeyBindings ) {
1400 if ( !kb.second.empty() )
1401 editor->getKeyBindings().addKeybindString( kb.second, kb.first );
1402 }
1403
1404 if ( editor->hasDocument() ) {
1405 auto& doc = editor->getDocument();
1406
1407 doc.setCommand( "lsp-go-to-definition", [this]( TextDocument::Client* client ) {
1408 getAndGoToLocation( static_cast<UICodeEditor*>( client ), "textDocument/definition" );
1409 } );
1410
1411 doc.setCommand( "lsp-rename-symbol-under-cursor", [this]( TextDocument::Client* client ) {
1412 renameSymbol( static_cast<UICodeEditor*>( client ) );
1413 } );
1414
1415 doc.setCommand( "lsp-go-to-declaration", [this]( TextDocument::Client* client ) {
1416 getAndGoToLocation( static_cast<UICodeEditor*>( client ), "textDocument/declaration" );
1417 } );
1418
1419 doc.setCommand( "lsp-go-to-implementation", [this]( TextDocument::Client* client ) {
1420 getAndGoToLocation( static_cast<UICodeEditor*>( client ),
1421 "textDocument/implementation" );
1422 } );
1423
1424 doc.setCommand( "lsp-go-to-type-definition", [this]( TextDocument::Client* client ) {
1425 getAndGoToLocation( static_cast<UICodeEditor*>( client ),
1426 "textDocument/typeDefinition" );
1427 } );
1428
1429 doc.setCommand( "lsp-switch-header-source", [this]( TextDocument::Client* client ) {
1430 switchSourceHeader( static_cast<UICodeEditor*>( client ) );
1431 } );
1432
1433 doc.setCommand( "lsp-symbol-info", [this]( TextDocument::Client* client ) {
1434 getSymbolInfo( static_cast<UICodeEditor*>( client ) );
1435 } );
1436
1437 doc.setCommand( "lsp-symbol-references", [this]( TextDocument::Client* client ) {
1438 mClientManager.getSymbolReferences(
1439 static_cast<UICodeEditor*>( client )->getDocumentRef() );
1440 } );
1441
1442 doc.setCommand( "lsp-symbol-code-action", [this]( TextDocument::Client* client ) {
1443 codeAction( static_cast<UICodeEditor*>( client ) );
1444 } );
1445
1446 doc.setCommand( "lsp-memory-usage", [this]( TextDocument::Client* client ) {
1447 mClientManager.memoryUsage( static_cast<UICodeEditor*>( client )->getDocumentRef() );
1448 } );
1449
1450 doc.setCommand( "lsp-refresh-semantic-highlighting",
1451 [this]( TextDocument::Client* client ) {
1452 mClientManager.requestSemanticHighlighting(

Callers

nothing calls this directly

Calls 15

getDocumentRefMethod · 0.80
addKeybindStringMethod · 0.80
getDocumentMethod · 0.80
getSymbolReferencesMethod · 0.80
rangeFormattingMethod · 0.80
push_backMethod · 0.80
asPixelsMethod · 0.80
getDPIMethod · 0.80
getUIThemeManagerMethod · 0.80
registerTopSpaceMethod · 0.80
hasFilepathMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected