pns_debug_tool: goto line windows + add visual studio (half working)

Visual studio (full) doesn't seem to like  going to the line, but at
least it opens the file in the same instance...
This commit is contained in:
Roberto Fernandez Bautista 2024-02-03 16:53:06 +01:00
parent b409aee28a
commit 8e0489bc24
3 changed files with 16 additions and 5 deletions

View File

@ -973,7 +973,7 @@
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;VS Code&quot; &quot;CLion&quot; &quot;Emacs&quot;</property>
<property name="choices">&quot;VS Code&quot; &quot;Visual Studio (full)&quot; &quot;CLion&quot; &quot;Emacs&quot;</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>

View File

@ -551,6 +551,16 @@ void PNS_LOG_VIEWER_FRAME::syncModel()
}
void runCommand( const wxString& aCommand )
{
#ifdef __WXMSW__
wxShell( aCommand ); // on windows we need to launch a shell in order to run the command
#else
wxExecute( aCommand );
#endif /* __WXMSW__ */
}
void PNS_LOG_VIEWER_FRAME::onListRightClick( wxMouseEvent& event )
{
auto sel = m_itemList->GetPopupMenuSelectionFromUser( *m_listPopupMenu );
@ -618,9 +628,10 @@ void PNS_LOG_VIEWER_FRAME::onListRightClick( wxMouseEvent& event )
switch( m_ideChoice->GetCurrentSelection() )
{
case 0: wxExecute( wxString::Format( "code --goto %s:%s", filepath, line ) ); return;
case 1: wxExecute( wxString::Format( "clion --line %s %s", line, filepath ) ); return;
case 2: wxExecute( wxString::Format( "emacsclient +%s %s", line, filepath ) ); return;
case 0: runCommand( wxString::Format( "code --goto %s:%s", filepath, line ) ); return;
case 1: runCommand( wxString::Format( "start devenv /edit %s /command \"Gotoln %s\"", filepath, line ) ); return; // fixme
case 2: runCommand( wxString::Format( "clion --line %s %s", line, filepath ) ); return;
case 3: runCommand( wxString::Format( "emacsclient +%s %s", line, filepath ) ); return;
default: return;
}
}

View File

@ -93,7 +93,7 @@ PNS_LOG_VIEWER_FRAME_BASE::PNS_LOG_VIEWER_FRAME_BASE( wxWindow* parent, wxWindow
fgSizer3->Add( m_ideLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
wxString m_ideChoiceChoices[] = { wxT("VS Code"), wxT("CLion"), wxT("Emacs") };
wxString m_ideChoiceChoices[] = { wxT("VS Code"), wxT("Visual Studio (full)"), wxT("CLion"), wxT("Emacs") };
int m_ideChoiceNChoices = sizeof( m_ideChoiceChoices ) / sizeof( wxString );
m_ideChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_ideChoiceNChoices, m_ideChoiceChoices, 0 );
m_ideChoice->SetSelection( 0 );