-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates to tcl cmds using 8.6.0 manual #28
Conversation
Of course these updates were done to the best of my knowledge/documentation/lack of consisten documentation Refactors will clearly be done in the future As of this update, currently skipped or UNDONE completers areas are: unload yield yieldto transchan try my self safe registry (because it requires a package) oo::create oo::object oo::define oo::copy oo::class next,nextto namespace [this was already not working in the original, I half-assed added a few missing commands (eg ensemble isnt complete at all) but it still doesnt work.] memory - because i needs tcl to be compile with debugging on lsearch interp info
That missing brace ruined everything as it was falling back to the default completer so verify check all other manual completers again since last major change
Hecka too tired to attempt this conundrum and everything else is pretty much done. We can use the old method until they deprecate it anyways
return "" | ||
switch -- $pos { | ||
1 { | ||
return [TryFromList $text {-encoding <filenName>}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filenName is likely a typo.
proc complete(update) {text start end line pos mod} { | ||
switch -- $pos { | ||
switch -- ${pos} { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The braces around the variable name are unnecessary here since there is no parsing ambiguity without them.
proc complete(variable) {text start end line pos mod} { | ||
set modulo [expr {$pos % 2}] | ||
set modulo [expr $pos % 2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The braces around the expr
argument were intentional and provide additional performance and security.
@@ -3571,7 +4389,7 @@ namespace eval tclreadline { | |||
if {"#" == [string index $one 0] || [regexp {^[0-9]*$} $one]} { | |||
incr virtual_pos | |||
} | |||
switch [expr {$virtual_pos % 2}] { | |||
switch [expr $virtual_pos % 2] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep the braces.
# Best I can do to notify user of option to body or continue list | ||
3 { return [DisplayHints {<body> ?varlist?}] } | ||
default { | ||
set modulo [expr $pos % 2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Braces around expr argument.
return "" | ||
} else { | ||
return [Quote $value $text] | ||
return [Quote $value ${text}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Braces are unnecessary for this variable reference..
if {"#" == [string index ${one} 0] || [regexp {^[0-9]*$} ${one}]} { | ||
return [CompleteFromList ${text} [CommandCompletion ${text}]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Braces are unnecessary for the variable references throughout this proc.
ensemble { return [CompleteFromList $text {create | ||
configure exists] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like you have a mismatch in closing braces here
Will review later when i have free time and make the changes that you suggest @bovine . Thank you |
closing due to lack of activity. If you intend to resubmit this, try to keep your edits more limited in scope to make the approval easier. |
Updates to tclreadline with accompany of 8.6.0 online tcl manual.
Completers Listed in Manual Completely Not Implemented/updated
yield
yieldto
transchan
try
self
registry (requires a Windows package)
oo::create
oo::object
oo::define
oo::copy
oo::class
my
next,nextto
memory - (because it needs tcl to be compile with debugging on)
lsearch
coroutine
chan - never had a completer
dict - never had a completer
Other's to examine for various reasons
apply - anonymous function prob cant complete intuitively??
expr - It's current completer had everything moved to
mathfunc
and seems to be unsupported in 8.6???file - a few optional options can be added
dde - Requires Windows
resource - Requires Mac
switch - index var and matchvar options need to recognize and account for the
indexvar <integer>
andmatchvar <$var>
continue - not really neccesary
close - didnt complete the two-argument form since "only sockets and command pipelines support half-close."
unload/load - doesnt guess the last few entries of the syntax
packagename
oriterp
namespace - [this was already not working in the original, I added a few missing subcmds (eg ensemble isnt complete at all) but it still doesnt work.]