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

add tab-complete to repl #176

Merged
merged 4 commits into from May 2, 2016

Conversation

Projects
None yet
2 participants
@deoxxa
Collaborator

deoxxa commented Apr 27, 2016

No description provided.

@stevenh

This comment has been minimized.

Collaborator

stevenh commented Apr 27, 2016

Can we get a proper PR description for this @deoxxa it seems you have two commits and you only mention the title from the first one.

@deoxxa

This comment has been minimized.

Collaborator

deoxxa commented Apr 27, 2016

What would you suggest instead? The first commit is only there to support the second one.

@stevenh

This comment has been minimized.

Collaborator

stevenh commented Apr 28, 2016

Something like:

Add tab-complete to repl

Add support for using tab complete when using repl.

This also adds the KeysByParent to otto objects which ....

Subject is typically a brief summary of the change and description provides the detail.

Given the recursive nature of KeysByParent could this cause significant slowdown when not desired?

If so would good to add a command line option to disable it.

@deoxxa

This comment has been minimized.

Collaborator

deoxxa commented Apr 28, 2016

Right - can do! Please hold :)

otto.go Outdated
@@ -655,6 +655,25 @@ func (self Object) Keys() []string {
return keys
}
// Get the keys (and those of the parents) for the object, in order of
// "closest" to "furthest"
func (self Object) KeysByParent() [][]string {

This comment has been minimized.

@stevenh

stevenh Apr 28, 2016

Collaborator

Would be nice if we started to pass linting with doc comments e.g. this should be of the form:

// KeysByParent returns the keys for the object, and those if its parents, in order of "closest" to "furthest".

This makes docs much nicer for external consumers.

This comment has been minimized.

@deoxxa

deoxxa Apr 28, 2016

Collaborator

Can't think of a reason why not!

This comment has been minimized.

@deoxxa

deoxxa Apr 28, 2016

Collaborator

Done and done.

@deoxxa

This comment has been minimized.

Collaborator

deoxxa commented Apr 28, 2016

Autocomplete is now opt-in. To avoid adding another set of OneAndTwoAndThree functions in the repl package, I added an Options struct type. The old functions still exist, and just map through to the RunWithOptions function, setting the equivalent fields on that argument.

@deoxxa deoxxa merged commit a55c9c9 into robertkrimen:master May 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment