Skip to content

Commit

Permalink
Fix command palette not displaying all available commands.
Browse files Browse the repository at this point in the history
Minor very rare crash in Debugger when unloading the plugin.
Formatter will try to refresh the semantic highlighting after a document format.
  • Loading branch information
SpartanJ committed Feb 13, 2025
1 parent b3ed22c commit dc927e0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/eepp/ui/doc/textdocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,9 @@ String TextDocument::getAllSelectedText() const {

std::vector<std::string> TextDocument::getCommandList() const {
std::vector<std::string> cmds;
cmds.reserve( mCommands.size() + mRefCommands.size() );
for ( const auto& cmd : mRefCommands )
cmds.push_back( cmd.first );
for ( const auto& cmd : mCommands )
cmds.push_back( cmd.first );
return cmds;
Expand Down
14 changes: 8 additions & 6 deletions src/tools/ecode/plugins/debugger/debuggerplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ static constexpr auto KEY_DEFAULT_BUILD_TASK = "${defaultBuildTask}";
static constexpr auto KEY_PATH_SEPARATOR = "${pathSeparator}";
static constexpr auto KEY_PATH_SEPARATOR_ABBR = "${/}";

// Mouse Hover Tooltip
static Action::UniqueID getMouseMoveHash( UICodeEditor* editor ) {
return hashCombine( String::hash( "DebuggerPlugin::onMouseMove-" ),
reinterpret_cast<Action::UniqueID>( editor ) );
}

Plugin* DebuggerPlugin::New( PluginManager* pluginManager ) {
return eeNew( DebuggerPlugin, ( pluginManager, false ) );
}
Expand Down Expand Up @@ -1406,6 +1412,8 @@ void DebuggerPlugin::onUnregisterEditor( UICodeEditor* editor ) {
editor->removeUnlockedCommands( DebuggerCommandList );

editor->unregisterGutterSpace( this );

editor->removeActionsByTag( getMouseMoveHash( editor ) );
}

void DebuggerPlugin::drawLineNumbersBefore( UICodeEditor* editor,
Expand Down Expand Up @@ -2175,12 +2183,6 @@ void DebuggerPlugin::setUIDebuggingState( StatusDebuggerController::State state
}
}

// Mouse Hover Tooltip
static Action::UniqueID getMouseMoveHash( UICodeEditor* editor ) {
return hashCombine( String::hash( "DebuggerPlugin::onMouseMove-" ),
reinterpret_cast<Action::UniqueID>( editor ) );
}

void DebuggerPlugin::displayTooltip( UICodeEditor* editor, const std::string& expression,
const EvaluateInfo& info, const Vector2f& position ) {
if ( mHoverTooltip == nullptr ) {
Expand Down
1 change: 1 addition & 0 deletions src/tools/ecode/plugins/formatter/formatterplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ void FormatterPlugin::formatDoc( UICodeEditor* editor ) {
doc->textInput( data, false );
doc->setSelection( pos );
editor->setScroll( scroll );
doc->execute( "lsp-refresh-semantic-highlighting", editor );
if ( mAutoFormatOnSave && mPluginManager &&
!String::startsWith( doc->getFilePath(),
mPluginManager->getPluginsPath() ) ) {
Expand Down

0 comments on commit dc927e0

Please sign in to comment.