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

Live templates #254

Closed
snuyanzin opened this issue Jan 8, 2019 · 2 comments
Closed

Live templates #254

snuyanzin opened this issue Jan 8, 2019 · 2 comments

Comments

@snuyanzin
Copy link
Collaborator

snuyanzin commented Jan 8, 2019

Jline3 provides expander functionality which is turned off in sqlline since beginning... (I guess the reason is that in case of default behaviour it expands if input word starts with an exclamation mark, like commands in sqlline)
The original idea of it is following [1].
At the same time Expander interface can expand something based on input word and history and something input word based only which are not started with !. It allows to introduce live templates like for instance in most IDEs.
The idea is

  1. provide functionality of live templates based on Jline3's expander functionality
  2. provide a list of built-in live templates (currently I think about simple property file)
  3. provide functionality to add new live templates via e.g. new specific commands
  4. live templates expansion should have lowest priority i.e. if anybody defines live templates the same as an existed command or keyword then completion will be done rather than live template expansion

here it is an implemented live template for ctas which will be expanded into create table as select after hitting tab 4ae059b
[1] https://www.gnu.org/software/bash/manual/html_node/Event-Designators.html

@julianhyde
Copy link
Owner

I'm glad that it's possible, but I don't think that it's very useful. I don't think I'd use it, personally. Maybe I expect less from a shell than I expect from an IDE. :)

@snuyanzin
Copy link
Collaborator Author

merged as b1887b1

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 a pull request may close this issue.

2 participants