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

Support auto completion of keywords in console #455

Merged
merged 6 commits into from
Jun 12, 2019
Merged

Support auto completion of keywords in console #455

merged 6 commits into from
Jun 12, 2019

Conversation

dutor
Copy link
Contributor

@dutor dutor commented May 28, 2019

For now, we only support simple completions based on the keywords. In future, we may add support to sub-command, or we could even combine readline and our lexer and parser.

This will close #448

@dutor dutor added the ready-for-testing PR: ready for the CI test label May 28, 2019
@nebula-community-bot
Copy link
Member

Unit testing passed.

3 similar comments
@nebula-community-bot
Copy link
Member

Unit testing passed.

@nebula-community-bot
Copy link
Member

Unit testing passed.

@nebula-community-bot
Copy link
Member

Unit testing passed.

Copy link
Contributor

@laura-ding laura-ding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done

@nebula-community-bot
Copy link
Member

Unit testing passed.

laura-ding
laura-ding previously approved these changes Jun 3, 2019
Copy link
Contributor

@laura-ding laura-ding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done

@nebula-community-bot
Copy link
Member

Unit testing passed.

@nebula-community-bot
Copy link
Member

Unit testing passed.


void CliManager::initAutoCompletion() {
// The completion function
::rl_attempted_completion_function = completer;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no default auto-complete module in readline? This is a very common feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the default one is to complete filenames.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you mean whether readline has builtin support to all these functions here(Given a collection of keywords, readline does all completion works for you). I'm afraid the answer seems no. I had been following up the official documents.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

。。。。The default module is useless if not allow users to pass custom keywords.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is. Actually, you could infer from the completer function, that if we don't have to support sub-keywords completion, all we need is to retrieve the longest common prefix of all completion candidates.

@nebula-community-bot
Copy link
Member

Unit testing passed.

@dutor dutor merged commit 0f18c44 into vesoft-inc:master Jun 12, 2019
@dutor dutor deleted the console-support-aut-completion branch June 12, 2019 13:22
yixinglu pushed a commit to yixinglu/nebula that referenced this pull request Feb 16, 2020
* Support auto completion of keywords in console

* Omit completion in quotes

* Use a resource file as completion rule

* Addressed @laura-ding's comments

* Address comments
tong-hao pushed a commit to tong-hao/nebula that referenced this pull request Jun 1, 2021
* Support auto completion of keywords in console

* Omit completion in quotes

* Use a resource file as completion rule

* Addressed @laura-ding's comments

* Address comments
yixinglu pushed a commit to yixinglu/nebula that referenced this pull request Mar 21, 2022
* snowflake id

* fix bug

* fix review

* remove redundant

* tmp

* tmp

* finish

* fix

* fix

* fix header

* fix header

* fix format

* fix test

* fix review

* fix bench

* add 64

* fix review

* fix review

* fix viarable

Co-authored-by: Sophie <84560950+Sophie-Xie@users.noreply.github.com>

Co-authored-by: jakevin <30525741+jackwener@users.noreply.github.com>
Co-authored-by: Sophie <84560950+Sophie-Xie@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is it possible to add automatic completion of the function variables?
5 participants