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

Method createLocationsView

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

Source from the content-addressed store, hash-verified

675}
676
677void LSPClientPlugin::createLocationsView( UICodeEditor* editor,
678 const std::vector<LSPLocation>& res ) {
679 auto model = LSPLocationModel::create( mManager->getWorkspaceFolder(), res );
680 createListView( editor, model, [this]( const ModelEvent* modelEvent ) {
681 if ( modelEvent->getModelEventType() != ModelEventType::Open )
682 return;
683 auto r = modelEvent->getModelIndex().row();
684 Variant uri( modelEvent->getModel()->data(
685 modelEvent->getModel()->index( r, LSPLocationModel::CustomInfo::URI ),
686 ModelRole::Custom ) );
687 Variant range( modelEvent->getModel()->data(
688 modelEvent->getModel()->index( r, LSPLocationModel::CustomInfo::TextRange ),
689 ModelRole::Custom ) );
690 LSPLocation loc;
691 loc.uri = URI( uri.asStdString() );
692 loc.range = TextRange::fromString( range.asStdString() );
693 mClientManager.goToLocation( loc );
694 modelEvent->getNode()->close();
695 } );
696}
697
698void LSPClientPlugin::createCodeActionsView( UICodeEditor* editor,
699 const std::vector<LSPCodeAction>& cas ) {

Callers

nothing calls this directly

Calls 9

fromStringFunction · 0.85
rowMethod · 0.80
getModelIndexMethod · 0.80
getNodeMethod · 0.80
closeMethod · 0.65
dataMethod · 0.45
getModelMethod · 0.45
indexMethod · 0.45
goToLocationMethod · 0.45

Tested by

no test coverage detected