| 675 | } |
| 676 | |
| 677 | void 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 | |
| 698 | void LSPClientPlugin::createCodeActionsView( UICodeEditor* editor, |
| 699 | const std::vector<LSPCodeAction>& cas ) { |
nothing calls this directly
no test coverage detected