Daemon icon indicating copy to clipboard operation
Daemon copied to clipboard

Namespace aware autocompletion. Resolves DaemonEngine/Daemon#449

Open peoro opened this issue 4 years ago • 5 comments

Some example of how autocompletion behaves with this patch ( is shown where I pressed tab):

]se↹
-> /se
   server.{x4}
   set                      sets the value of a cvar
   seta                     sets the value of a cvar and marks the cvar as archived
   sets                     sets the value of a cvar
   setu                     sets the value of a cvar
]ser↹
-> /server.
   server.challenge.{x3}
   server.private           cvar - "3" - server private - Controls how much the server advertises: 0 - Advertise everything, 1 - Don't advertise but reply to status queries, 2 - Don't reply to status queries but accept connections, 3 - Only accept LAN connections.
]server.c↹
-> /server.challenge.
   server.challenge.count   cvar - "1024" - uint - Maximum number of active challenges kept in memory - between 1 and 115292150460684697
   server.challenge.length  cvar - "8" - uint - Length in bytes of the challenge data (The hexadecimal representation will be twice as long) - between 1 and 9223372036854775807
   server.challenge.timeout cvar - "5" - int - Timeout (in seconds) of a challenge - between 1 and 2147483647
]a↹
-> /a
   alias     creates or view an alias
   arg_all   ""
   arg_count "0"
]/set a.a 1
]a↹
-> /a
   a.a       "1"
   alias     creates or view an alias
   arg_all   ""
   arg_count "0"
]/set a.b 1
]a↹
-> /a
   a.{x2}
   alias     creates or view an alias
   arg_all   ""
   arg_count "0"
]a.↹
-> /a.
   a.a "1"
   a.b "1"
]log↹
-> /logs.
   logs.logFile.{x4}
   logs.logLevel.{x8}
   logs.suppression.{x4}
]/set b.b.b.b.0
]/set b.b.b.b.1
]b.↹
-> /b.b.b.b.
   b.b.b.b.0 ""
   b.b.b.b.1 ""

peoro avatar Apr 19 '21 16:04 peoro

This logic should probably go in the CompleteCommandNames function

slipher avatar Apr 26 '21 07:04 slipher

What if we treated _ the same way as .? Then it would also work with cvars having Quake naming conventions such as r_fullscreen.

slipher avatar May 31 '21 16:05 slipher

What if we treated _ the same way as .? Then it would also work with cvars having Quake naming conventions such as r_fullscreen.

That sounds good!

illwieckz avatar May 31 '21 22:05 illwieckz

gentle bump

necessarily-equal avatar Oct 18 '21 20:10 necessarily-equal

Are the 2 remarks here blocking? Talking about those:

This logic should probably go in the CompleteCommandNames function

What if we treated _ the same way as .? Then it would also work with cvars having Quake naming conventions such as r_fullscreen.

ghost avatar Jul 20 '22 12:07 ghost

Done in #723.

slipher avatar Nov 03 '22 11:11 slipher