@@ -111,7 +111,7 @@ GolangEdit::GolangEdit(LiteApi::IApplication *app, QObject *parent) :
111
111
m_enableUseGuru = true ;
112
112
m_liteApp->appendLog (" GolangEdit" ,QString (" Found guru at %1" ).arg (m_guruFilePath),false );
113
113
} else {
114
- m_liteApp->appendLog (" GolangEdit" ,QString (" Not found guru!" ),false );
114
+ m_liteApp->appendLog (" GolangEdit" ,QString (" Not found guru, back to oracle !" ),false );
115
115
}
116
116
117
117
connect (m_liteApp->editorManager (),SIGNAL (editorCreated (LiteApi::IEditor*)),this ,SLOT (editorCreated (LiteApi::IEditor*)));
@@ -758,23 +758,30 @@ void GolangEdit::sourceQueryFinished(int code, QProcess::ExitStatus /*status*/)
758
758
void GolangEdit::dbclickSourceQueryOutput (const QTextCursor &cursor)
759
759
{
760
760
QTextCursor cur = cursor;
761
- cur.select (QTextCursor::WordUnderCursor);
762
- QStringList actions;
763
- actions << " callees" << " callers" << " callstack" << " definition" << " describe" << " freevars" << " implements" << " peers" << " referrers" << " pointsto" << " whicherrs" ;
764
- QString text = cur.selectedText ();
765
- if (actions.contains (text)) {
766
- runSourceQueryByInfo (text);
767
- return ;
768
- }
769
761
cur.select (QTextCursor::LineUnderCursor);
770
- text = cur.selectedText ();
762
+ QString text = cur.selectedText ();
771
763
if (text.isEmpty ()) {
772
764
return ;
773
765
}
766
+
767
+ bool hasGotoLine = false ;
774
768
QRegExp reg (" ((?:[a-zA-Z]:)?[\\ w\\ d_\\ s\\ -\\\\ /\\ .]+):(\\ d+)[\\ .:]?(\\ d+)?\\ -?(\\ d+)?\\ .?(\\ d+)?\\ b" );
775
- if (reg.indexIn (text) < 0 ) {
769
+ if (reg.indexIn (text) >= 0 ) {
770
+ hasGotoLine = true ;
771
+ }
772
+
773
+ if (!hasGotoLine) {
774
+ QTextCursor cur = cursor;
775
+ cur.select (QTextCursor::WordUnderCursor);
776
+ QString text = cur.selectedText ();
777
+ QStringList actions;
778
+ actions << " callees" << " callers" << " callstack" << " definition" << " describe" << " freevars" << " implements" << " peers" << " referrers" << " pointsto" << " whicherrs" ;
779
+ if (actions.contains (text)) {
780
+ runSourceQueryByInfo (text);
781
+ }
776
782
return ;
777
783
}
784
+
778
785
QStringList capList = reg.capturedTexts ();
779
786
if (capList.count () < 5 ) {
780
787
return ;
0 commit comments