@@ -1625,19 +1625,8 @@ def get_all_commands(self) -> List[str]:
1625
1625
1626
1626
def get_visible_commands (self ) -> List [str ]:
1627
1627
"""Return a list of commands that have not been hidden or disabled"""
1628
- commands = self .get_all_commands ()
1629
-
1630
- # Remove the hidden commands
1631
- for name in self .hidden_commands :
1632
- if name in commands :
1633
- commands .remove (name )
1634
-
1635
- # Remove the disabled commands
1636
- for name in self .disabled_commands :
1637
- if name in commands :
1638
- commands .remove (name )
1639
-
1640
- return commands
1628
+ return [command for command in self .get_all_commands ()
1629
+ if command not in self .hidden_commands and command not in self .disabled_commands ]
1641
1630
1642
1631
def _get_alias_completion_items (self ) -> List [CompletionItem ]:
1643
1632
"""Return list of current alias names and values as CompletionItems"""
@@ -1659,9 +1648,13 @@ def _get_commands_aliases_and_macros_for_completion(self) -> List[str]:
1659
1648
return list (visible_commands | alias_names | macro_names )
1660
1649
1661
1650
def get_help_topics (self ) -> List [str ]:
1662
- """ Returns a list of help topics """
1663
- return [name [len (HELP_FUNC_PREFIX ):] for name in self .get_names ()
1664
- if name .startswith (HELP_FUNC_PREFIX ) and callable (getattr (self , name ))]
1651
+ """Return a list of help topics"""
1652
+ all_topics = [name [len (HELP_FUNC_PREFIX ):] for name in self .get_names ()
1653
+ if name .startswith (HELP_FUNC_PREFIX ) and callable (getattr (self , name ))]
1654
+
1655
+ # Filter out hidden and disabled commands
1656
+ return [topic for topic in all_topics
1657
+ if topic not in self .hidden_commands and topic not in self .disabled_commands ]
1665
1658
1666
1659
# noinspection PyUnusedLocal
1667
1660
def sigint_handler (self , signum : int , frame ) -> None :
0 commit comments