Skip to content
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

Closed
wants to merge 72 commits into from

Conversation

SavSanta
Copy link

@SavSanta SavSanta commented Dec 9, 2019

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> and matchvar <$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 or iterp
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.]

SavSanta added 30 commits November 23, 2019 07:34
SavSanta added 25 commits December 3, 2019 11:55
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>}]
Copy link
Member

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} {
Copy link
Member

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]
Copy link
Member

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] {
Copy link
Member

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]
Copy link
Member

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}]
Copy link
Member

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..

Comment on lines +4350 to +4351
if {"#" == [string index ${one} 0] || [regexp {^[0-9]*$} ${one}]} {
return [CompleteFromList ${text} [CommandCompletion ${text}]]
Copy link
Member

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.

Comment on lines +3219 to +3220
ensemble { return [CompleteFromList $text {create
configure exists] }
Copy link
Member

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

@SavSanta
Copy link
Author

SavSanta commented Aug 4, 2020

Will review later when i have free time and make the changes that you suggest @bovine . Thank you

@bovine
Copy link
Member

bovine commented Aug 13, 2024

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.

@bovine bovine closed this Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants