Highlight braced stored-proc names in lappend arguments #42
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/42/head"
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 updates the semantic token highlighter so that stored-procedure names appearing as braced arguments to
lappend(and::lappend) are emitted with thefunctiontoken type.Before: braced literal arguments to
lappendthat matched known custom or standard procedure names were not highlighted as functions.After: when the command routine is
lappendor::lappend, anyBracedWordargument whosecontentsmatchesself._custom_function_names | _STANDARD_PROC_NAMESis recorded as afunctiontoken at the argument'scontents_poswith lengthlen(argument.contents).Key changes
BracedWordfromtclint.syntax_tree._Highlighter.visit_command, detectlappend/::lappendand iteratecommand.args:BracedWordand itscontentsis in the union of custom and standard proc names, append afunctionsemantic token usingargument.contents_posandlen(argument.contents).Testing
No test execution results were provided.
Recommended checks for reviewers:
lappend mylist {stored_proc}wherestored_procis present in the project's custom function set, and run the semantic token generation to confirm afunctiontoken is emitted for the braced name at the expected position and length.Notes / Risk
lappend/::lappendand only when the braced literal matches known custom or standard procedure names.argument.contents_posfor token placement; reviewers may want to confirm that position computation matches other token emission code paths.