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

fixes shell completion #454

Merged
merged 1 commit into from
May 17, 2022
Merged

fixes shell completion #454

merged 1 commit into from
May 17, 2022

Conversation

grob
Copy link
Member

@grob grob commented May 15, 2022

retrieving completion candidates failed if a global property getter used require() (i.e. console) because the global scope doesn't have a worker attached.

this fix introduces a new method getProperty in RingoWorker class to ensure there's a worker bound to the current thread before retrieving completion candidates using ScriptableObject.getProperty as this method executes getter functions.

other notable changes:

  • disable history expansion in terminal because ! would be interpreted as backwards history search
  • don't limit completion candidate retrieval, as jline3 prompts if there are many of them
  • don't omit printing out undefined return values, instead print them using a light grey color, and omit executing empty lines in shell

retrieving completion candidates failed if a global property getter used `require()` (i.e. `console`) because the global scope doesn't have a worker attached.

this fix introduces a new method `getProperty` in `RingoWorker` class to ensure there's a worker bound to the current thread before retrieving completion candidates using `ScriptableObject.getProperty` as this method executes getter functions.

other notable changes:
- disable history expansion in terminal because `!` would be interpreted as backwards history search
- don't limit completion candidate retrieval, as jline3 prompts if there are many of them
- don't omit printing out `undefined` return values, instead print them using a light grey color, and omit executing empty lines in shell
@grob grob requested a review from botic May 15, 2022 07:52
Copy link
Member

@botic botic left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for looking into the shell completion!

@botic botic merged commit 0d687e2 into main May 17, 2022
@botic botic deleted the fix/shell-completion branch May 17, 2022 09:57
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 this pull request may close these issues.

2 participants