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

Method onMouseClick

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

Source from the content-addressed store, hash-verified

615}
616
617bool LSPClientPlugin::onMouseClick( UICodeEditor* editor, const Vector2i& pos,
618 const Uint32& flags ) {
619 const bool breadcrumbClick = mBreadcrumb && ( flags & EE_BUTTON_LMASK );
620 const Vector2f localPos( breadcrumbClick ? editor->convertToNodeSpace( pos.asFloat() )
621 : Vector2f::Zero );
622 if ( breadcrumbClick && localPos.y >= 0 && localPos.y < mPluginTopSpace &&
623 localPos.x < editor->getTopAreaWidth() ) {
624 const Vector2f downLocalPos( editor->convertToNodeSpace(
625 editor->getEventDispatcher()->getMouseDownPos().asFloat() ) );
626 if ( downLocalPos.y >= 0 && downLocalPos.y < mPluginTopSpace &&
627 downLocalPos.x < editor->getTopAreaWidth() ) {
628 editor->getDocument().execute( "lsp-show-document-symbols", editor );
629 return true;
630 }
631 }
632
633 Input* input = editor->getInput();
634 Uint32 mod = input->getSanitizedModState();
635 if ( mod != ( KEYMOD_LALT | KeyMod::getDefaultModifier() ) || ( flags & EE_BUTTON_LMASK ) == 0 )
636 return false;
637
638 auto docPos = editor->resolveScreenPosition( pos.asFloat() );
639 if ( !docPos.isValid() || !editor->getDocument().isValidPosition( docPos ) )
640 return false;
641
642 editor->getDocument().execute( "lsp-go-to-definition", editor );
643
644 return true;
645}
646
647bool LSPClientPlugin::semanticHighlightingEnabled() const {
648 return mSemanticHighlighting;

Callers

nothing calls this directly

Calls 12

convertToNodeSpaceMethod · 0.80
getTopAreaWidthMethod · 0.80
getMouseDownPosMethod · 0.80
getDocumentMethod · 0.80
getSanitizedModStateMethod · 0.80
resolveScreenPositionMethod · 0.80
isValidPositionMethod · 0.80
asFloatMethod · 0.45
getEventDispatcherMethod · 0.45
executeMethod · 0.45
getInputMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected