Add Tcl 'trace' command completions and dynamic rules #65
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
state: Done
state: New
type: Bug
type: Feature
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Christoph/nx_post_support!65
Loading…
Reference in a new issue
No description provided.
Delete branch "61-trace-has-no-options"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This change adds completions and dynamic completion rules for the Tcl
tracecommand inserver/src/tools/tcl_command_completion.pyso that subcommands, mode values and argument kinds are suggested while composingtraceinvocations.Summary of changes
Register
tracesubcommands inSUBCOMMANDS_BY_PATH:("trace",) -> ("add", "info", "remove")("trace", "add"),("trace","info"),("trace","remove") -> ("command","execution","variable")Provide concrete value suggestions at position 4 (
VALUES_BY_POSITION) for the differenttracekinds:trace ... command->("rename", "delete")trace ... execution->("enter", "leave", "enterstep", "leavestep")trace ... variable->("array", "read", "write", "unset")removeas well asadd.Add dynamic completion rules (
DYNAMIC_COMPLETION_RULES) to suggest argument kinds at position 3 (indexfrozenset({3})):trace <add|info|remove> variableuseDynamicCompletionKind.VARIABLE.trace <add|info|remove> commandandtrace <add|info|remove> executionuseDynamicCompletionKind.PROCEDURE.Concrete before/after behavior
tracehad no dedicated entries in the completion tables, so the completion system would not offer the subcommands, mode tokens, or context-sensitive argument completions fortraceinvocations.add|info|removeastracesubcommands, suggestcommand|execution|variablefor those subcommands, suggest the specific mode tokens at the fourth token, and provide dynamic suggestions of variable names or procedure names at the third argument depending on the chosen kind.Tests
No test execution results were provided.
Recommended manual checks for the reviewer
SUBCOMMANDS_BY_PATHcontains the threetracesubcommand entries and that they appear in the completion UI fortrace.trace add command <TAB>(or the completion entry point for token index 3) the completion system proposes procedures, and thattrace add variable <TAB>proposes variable names.rename,delete,enter,leave,enterstep,leavestep,array,read,write,unset) are suggested at the fourth token whereVALUES_BY_POSITIONentries were added.Compatibility / notes for reviewers
tcl_command_completion.pyand does not alter runtime Tcl behavior.3(the argument to be completed), whileVALUES_BY_POSITIONentries target index4for mode tokens. Ensure these indices match the completion engine's token indexing.If you want, I can add a short script or reproducible completion examples that invoke the completion routines on example inputs to make manual verification faster.
Closes #61