-
Notifications
You must be signed in to change notification settings - Fork 147
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
Sql syntax highlight support #164
Comments
Current version from which the screenshot was taken is available at https://github.com/snuyanzin/sqlline/tree/SQLLINE_164 |
|
As far as I was able to understand in case of |
Very nice. I especially like how you have used the JDBC driver to find keywords. You have mis-spelled "highlight" as "hightlight" in a few places; please fix. Let's split the checkstyle upgrade and highlighting into separate commits. (Are they both in #165 right now? I haven't checked whether they are separable in the pull request. If you think they are, I'll just commit checkstyle now.) Even though checkstyle doesn't enforce it, please change lines like
to
A few ideas how this could be extended:
Useful if you are running in a terminal that is white text on black background.
I know these are hard. Which of them, in your opinion, are worth doing? |
Thank you for your response.
Yes it was first this ticket related commit and this was fixed in further commits
No #165 is independent and could be committed separately. By saying based on #165 I mean that I did my local rebase.
Thank you for pointing to this. So if it is possible it would be nice to have checkstyle related PR committed. About ideas (thank you very much for sharing them):
|
Some updates from my side
@julianhyde could you please merge #165 and then I will make a PR for this issue if it is ok [1] https://github.com/Gillisdc/sqldeveloper-syntax-highlighting |
By the way I have a suggestion to use widgets to switch between color schemes. |
I like the idea of a widget switch between color schemes. Maybe a keystroke could rotate through the available color schemes (there shouldn't be too many). It would be useful if I were giving a presentation. But there would be a variable for color scheme as well, right? Then I could add it to my command-line parameters. |
Yes, exactly. |
Added a widget with a keyboard combination The keyboard combination could be changed however have to take into account there is only a limited set of possible combinations because of lots of bounded jline3 widgets for instance |
I have reviewed your PR #176:
|
When I tried '!set colorscheme invalid', it accepted it without error, and the next thing I typed (as it happens, up-arrow) caused sqlline to go into a loop, printing
and not accepting any input. Let's fix that before we merge. |
Thank you for the feedback and findings.
Yes it becomes better, thank you.
Yes I agree about weak map here and use it in PR
There is the similar issue is with
for me it is ok, so I did renaming in the mentioned PR |
Did you document the alt-h key-stroke? I couldn't find it. |
I'm curious why you didn't add it to DatabaseConnection, which seems simpler to me. (Weak map is fine, no need to change it.) |
I took a stab at removing |
Why did I do it before? Well as far as I remember(it was about a month ago) I wanted to encapsulate everything related to highlighting. The only comments I have to your commit e91298e:
|
No, I didn't. But what is the place where it could be added? The only thing I could imagine is Line 2769 in e91298e
At the same time it would make sense to have a list of available key-strokes with brief descriptions (plenty of new key-strokes appeared after moving to jline3). May be a separate section in the manual which would aggregate such list of key-strokes. |
Maybe a (brief) hot-keys section in the output of |
Fixed in 9448b38, which was based on PR #176 with a few of my changes. There are a few follow-up tasks (documenting alt-h, #187 and #190, and auto-completion of the |
Currently there is
color
property in sqlline but it has nothing in common with syntax highliting...Does it make sense to have a different property to switch on/off sql syntax?
About syntax highlighting it self.
Currently have done it in my sandbox in the next way
The initial color scheme is defined in
Application
and could be rewrittenthe initial color scheme looks like
sql-keywords.properties
) - blue boldany suggestions about relating to color scheme improvement are welcome (however it is customizable as other
Application
stuff)To provide more real example of how it could look like there is a screenshot
The text was updated successfully, but these errors were encountered: