-
Notifications
You must be signed in to change notification settings - Fork 2.8k
ZEPPELIN-277 Add Tab as Autocomplete for Notebook non-md paragraphs #2542
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
655ba88
ZEPPELIN-277 Add Tab as Autocomplete for Notebook non-md paragraphs
malayhm 5f4d81c
If all the previous line characters are tab, don't show autocomplete …
malayhm 973068b
apply tab completion based on editor.completionKey
Leemoonsoo 05d5860
Update doc
Leemoonsoo 865c0a6
Set python and spark interpreter completionKey
Leemoonsoo 46f612a
ZEPPELIN-277 Add Tab as Autocomplete for Notebook non-md paragraphs
malayhm 77b47b6
If all the previous line characters are tab, don't show autocomplete …
malayhm 77afdba
fix style
Leemoonsoo 2ec879d
Merge pull request #1 from Leemoonsoo/ZEPPELIN-277-completion-key
malayhm a75f0fe
Improved the first character check logic
malayhm 63d69e1
Merge branch 'ZEPPELIN-277' of github.com:malayhm/zeppelin into ZEPPE…
malayhm b09730e
Merge branch 'master' into ZEPPELIN-277
malayhm 18fc814
Merge branch 'master' into ZEPPELIN-277
malayhm b37e084
Fixed lint error
malayhm 436f22d
Added Tab auto completion flag for python sql and r
malayhm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think python interpreter should use the existing auto completion key as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @malayhm for the improvement.
Like @1ambda mentioned, each different interpreter (language) may use auto-completion key (tab) differently.
Could you take a look comment https://issues.apache.org/jira/browse/ZEPPELIN-2736?focusedCommentId=16077868&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16077868?
Editor configurations, such as 'language', 'editOnDblClick' are already defined in each interpreter-setting.json file and transfered to front-end.
I think we can add 'completionKey' in 'editor' under interpreter-setting.json and make conditionally apply autocompletion key based on this property.
@malayhm what do you think?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Leemoonsoo Yes, it would be better to give the user an option to select what should be the shortcut for code completion. But I fear that user may not go to each interpreter and change the shortcut. We can go with Tab as default shortcut and the user can choose if they want any different shortcut.
What do you think about having separate default shortcuts for a different interpreter or same for all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Interpreter setting" in zeppelin is a bit confusing because we use this words in two different places. One place is in 'Interpreter' menu, we can create interpreter settings and configure them. Another place is "Interpreter-setting.json" in each interpreter's source tree, which has default values for property and some immutable configurations.
What I meant was the immutable configuration in the second one.
For example markdown interpreter has immutable 'editor' configuration, like
And editor property can be accessed from the front end, like here or here.
So, we can make Tab or any other key as a default key for completion, but developers of each interpreter should able to override best completion key for each interpreter in the source code of interpreter.
I haven't thought deeply about each user override shortcut of completion key. But once Zeppelin allow user customizing shortcut, I think it will be not only completion key, but all other shortcut keys.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Leemoonsoo IMHO, we should not make autocomplete configurable through immutable editor configuration for following reasons:
A notebook can have mixed paragraph types and hence mixed interpreter which will have different autocomplete and will make a user think everytime they want to use autocomplete. This will result into bad UX.
In case where interpreters are shared, change to interpreter autocomplete setting will make it spread across the notebook and impact the behavior of other users
Talking from the code perspective, it will become tricky to change the shortcut at the runtime for existing paragraphs of opened notebooks if settings are changed elsewhere
For simplicity, the following should be the behavior:
In this way, the user will have clarity on what is the shortcut without putting any thoughts to it and it will be easy to communicate and document as well. This is the behavior in all the IDEs as well, e.g.:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zjffdu I think we will make tab as default autocomplete but at the same time we have to disable autocomplete for a few interpreters, e.g.
md.@Leemoonsoo has asked if we have to add more interpreters to the exclusion list in this PR apart from
md.@Leemoonsoo I can't think of any other exclusion as of now. It doesn't mean we should not add more inclusion in future. Today we don't have any exclusion for
Ctrl+.autocomplete, hence it should be fine moving with the current work done in the PR.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make tab as a default completion key, I wish we address following two
Improve tab completion behavior
This code brings completion list anytime user press tab if cursor is not the 0 column in the line. But i think we need little bit of improvement here. For example Jupyter does not brings completion unless there's any char before cursor on tab key press.
you'll realize it's not easy to write
echo "TAB".I can find many similar other cases with SQL, and other languages.
Move completion key selection from front-end to interpreter implementation
We can't really assume that every interpreter is okay with tab key completion.
And Zeppelin Interpreter is pluggable module. There're community managed interpreters as well as 3rd party interpreters. And asking front-end code change to configure pluggable module is not really a good idea I think.
We really need make interpreter contain completion key configuration, not hardcode completion key in the front-end side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Leemoonsoo I agree with point 1, I will make the changes in this PR.
Regarding point 2, can we take it up as a separate item with some feedback from the users so that we can make customer centric decision?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay,
Then, do you mind If I create a pullrequest to your branch for point 2? I really think it's benefit to developers who develop new interpreter choose completion key without touching front-end code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Leemoonsoo Sure.