From a72df6a805d424705727911e3b5c19f380b99233 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Sun, 21 Jun 2026 12:24:34 +0300 Subject: [PATCH] feat(command): surface one-shot commands in command-line autocomplete MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit File/view/layer/style/undo-redo and similar one-shot commands dispatch a single action instead of installing an interactive CadCommand, so they had no module to register from and never appeared in autocomplete. Add a consolidated CommandRegistration covering all 132 user-typeable one-shots (NEW, OPEN, SAVE, SAVEAS, PLOT, PURGE, UNDO, REDO, ZOOM, LAYER, XREF, …). Internal dispatch tokens the user never types (REFEDIT_BEGIN, REFCLOSE_SAVE, REFCLOSE_DISCARD) stay excluded. Co-Authored-By: Claude Opus 4.8 --- src/app/commands.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/app/commands.rs b/src/app/commands.rs index 358dcb109..75a231378 100644 --- a/src/app/commands.rs +++ b/src/app/commands.rs @@ -5943,3 +5943,32 @@ fn csv_escape(s: &str) -> String { s.to_string() } } + +// ── Autocomplete registry — one-shot commands ────────────────────────────── +// These commands dispatch a single action (file ops, view, layer/style +// managers, undo/redo, …) rather than installing an interactive `CadCommand`, +// so they have no module of their own to register from. They are surfaced for +// command-line autocomplete here. Internal dispatch tokens that the user never +// types (REFEDIT_BEGIN, REFCLOSE_SAVE, REFCLOSE_DISCARD) are intentionally +// excluded. +inventory::submit!(crate::command::CommandRegistration { + names: &[ + "3DORBIT", "3O", "ABOUT", "ATTDISP", "ATTEXT", "BACKGROUND", "CDIMSTY", "CELTSCALE", + "CHANGELOG", "CHPROP", "CLAYER", "CLEAR", "CLR", "COLORSCHEME", "COUNT", "DATAEXTRACTION", + "DE", "DESELALL", "DESELECT", "DIMSTYLE", "DONATE", "DRAWORDER", "DWGPROP", "DWGPROPS", + "EATTEXT", "EXIT", "EXPORT", "EXPORTSTEP", "EXPORTSTL", "FILETAB", "FIND", "FLATTEN", + "HELP", "HIDEOBJECTS", "IM", "IMAGE", "IMAGEATTACH", "IMPORTOBJ", "ISOLATEOBJECTS", "LA", + "LAYER", "LAYERS", "LAYISO", "LAYON", "LAYOUTMANAGER", "LAYOUTPANEL", "LAYOUTTAB", "LAYTHW", + "LAYUNISO", "LI", "LINETYPE", "LIST", "LTSCALE", "LWDISPLAY", "MASSPROP", "MLEADERSTYLE", + "MLSTYLE", "MS", "MSPACE", "NAVVCUBE", "NEW", "OBJIMPORT", "OPEN", "ORTHO", + "PAGESETUP", "PERF", "PERSP", "PLOT", "PLOTSTYLE", "PLOTSTYLEEDITOR", "PLOTSTYLEPANEL", "PR", + "PRINT", "PROPERTIES", "PROPS", "PSPACE", "PURGE", "QS", "QSAVE", "QSELECT", + "QUIT", "REDO", "REDRAW", "REDRWALL", "REGEN", "REGENALL", "RENAME", "REPORT", + "SA", "SAVE", "SAVEAS", "SCALETEXT", "SELECTALL", "SELECTSIMILAR", "SELSIM", "SHEETSET", + "SHORTCUTS", "SOLID", "SSM", "STEPOUT", "STLOUT", "STPOUT", "STYLE", "STYLESMANAGER", + "TABLESTYLE", "TOOLPALETTES", "TP", "TS", "U", "UCS", "UCSICON", "UNDERLAY", + "UNDO", "UNISOLATEOBJECTS", "USERI", "USERR", "VIEW", "VPORTS", "VS", "VW", + "WB", "WBLOCK", "WEBVERSION", "WIREFRAME", "XA", "XATTACH", "XDATA", "XR", + "XREF", "XRELOAD", "ZOOM", "ZS", + ] +});