Support optional once for MOM_enable/disable_address; update extension icon #56
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!56
Loading…
Reference in a new issue
No description provided.
Delete branch "newIcon"
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 support for an optional
oncekeyword as the first argument toMOM_enable_addressandMOM_disable_address, updates completion/inlay hint logic to recognise and skip that optional keyword, and replaces the extension icon withimages/dc-1.png.Summary of changes
Completion signatures and metadata
server/src/common/completion_list.json: theformatandparametersforMOM_enable_addressandMOM_disable_addresswere updated to document an optionaloncekeyword (format->MOM_*_address [once] <address_1 ... address_n>and aonceparameter entry added).Argument-kind detection
server/src/tools/def_flow.py: introduced_OPTIONAL_ONCE_COMMANDSand modifieddef_argument_kindsso that when the first argument is the literalonce(case-insensitive) it is not treated as an address argument. This ensures downstream logic that determines argument kinds ignores the optional keyword.Inlay hint handling
server/src/tools/inlay_hint.py:InlayHintParameternow has akeywordfield. Signature building reads thekeywordfrom completion metadata. The inlay hint generator skips optional keyword parameters when the actual call does not use them and adjusts parameter indexing so variadic/remaining parameters align correctly.Command completion behavior
server/src/tools/tcl_command_completion.py: addedonceas a suggested value for position 1 ofMOM_enable_addressandMOM_disable_address. The dynamic completion rules for these commands now use the repeated-argument rule (_REPEATED_ARGUMENTS), allowing multiple addresses after the optional keyword.Tests
server/tests/python_tests/test_tcloo_arguments.py: addedtest_optional_keyword_parameter_is_skipped_when_absent()which constructs signatures and asserts the produced inlay hints includeonce:when present and skip it when absent.Icon update
images/dc-1.png: new file added.package.json:iconfield changed fromimages/nx-1.pngtoimages/dc-1.png.Why this matters (concrete behavior)
Before this change, the code and completion metadata treated the first argument of
MOM_enable_address/MOM_disable_addressas an address unconditionally. Calls using theoncekeyword (for exampleMOM_enable_address once A3 B4) could have produced incorrect argument-kind classification and inlay hints. After the change:MOM_enable_address once A3 B4is treated as: optional keywordonce, followed by address arguments.MOM_enable_address A3 B4is treated as: only address arguments (the optionalonceparameter is skipped).The completion suggestions and inlay hints now reflect this optional keyword and will not misclassify the
oncetoken as an address.Tests
server/tests/python_tests/test_tcloo_arguments.py(new test functiontest_optional_keyword_parameter_is_skipped_when_absent).Recommended checks for reviewers:
MOM_enable_address A3 B4(noonce:inlay hint; address hints for A3/B4)MOM_enable_address once A3 B4(once:inlay hint followed by address hints)oncein the first argument position and address completions thereafter.images/dc-1.pngand thatpackage.jsonpoints to the correct icon.Compatibility and reviewer notes
oncecontinue to work; code now recognisesonceas an explicit optional keyword.