ion merge requestshttps://gitlab.redox-os.org/redox-os/ion/-/merge_requests2018-12-12T06:25:10Zhttps://gitlab.redox-os.org/redox-os/ion/-/merge_requests/815Ready for Review- Examples benchmark script2018-12-12T06:25:10ZNick PaladinoReady for Review- Examples benchmark scriptRe purposed run_examples.sh script. SUPER WIP and first code contribution from me. Lets see how this goes!Re purposed run_examples.sh script. SUPER WIP and first code contribution from me. Lets see how this goes!https://gitlab.redox-os.org/redox-os/ion/-/merge_requests/505Change time from builtin to shell keyword.2017-09-15T00:45:41ZMichael Aaron Murphymmstick@pm.meChange time from builtin to shell keyword.*Created by: chrisvittal*
**Problem**: The `time` command could not accept shell commands like builtins or for loops. #490
**Solution**: Refactored `time` from a builtin to a keyword. That is, create a `Statement::Time` and
handle ...*Created by: chrisvittal*
**Problem**: The `time` command could not accept shell commands like builtins or for loops. #490
**Solution**: Refactored `time` from a builtin to a keyword. That is, create a `Statement::Time` and
handle the `time` logic in the execution of `Statement::Time` variants, rather than as a builtin function.
**Changes introduced by this pull request**:
- A `Time` variant of `Statement` a boxed statement member.
- Support for parsing the time keyword in `parser/statement/parse.rs` by
recursing on the rest of the input to the `parse` function when time is
encountered.
- A port of the logic from the old builtin into the `execute_toplevel`
impl for `Shell`, where instead of using the error handling from
Command, the time statement is executed through a recursive call to
`execute_toplevel`.
- The removal of all references to the old `time` builtin.
**Drawbacks**: The loss of some friendliness. The `time -h` invocation no longer works.
**TODOs**:
- Add tests.
- Time currently cannot handle multiline statements like quotes being spread over multiple lines. Fix this.
- Remove `builtins/time.rs` file
- Edit: 2017-08-23 Implemented at current, a `time` statement inside of a loop supresses all output. Fix this.
**Fixes**: #490
**State**: WIP
https://gitlab.redox-os.org/redox-os/ion/-/merge_requests/791WIP: Ion Specification2018-06-15T13:55:25ZMichael Aaron Murphymmstick@pm.meWIP: Ion SpecificationFor all whom are willing to contribute to documenting the Ion specification, please step forward. This is going to take a while...For all whom are willing to contribute to documenting the Ion specification, please step forward. This is going to take a while...https://gitlab.redox-os.org/redox-os/ion/-/merge_requests/780WIP: Tab completions2020-04-23T03:18:26ZBafDyceWIP: Tab completions**IMPORTANT**
This is sorta, kinda WIP and NOT intended to be merged as it is!
The code still needs a few tweaks, and the commits are not meaningful on their own (I just committed all wip-stuff at once when I made breaks). This is more...**IMPORTANT**
This is sorta, kinda WIP and NOT intended to be merged as it is!
The code still needs a few tweaks, and the commits are not meaningful on their own (I just committed all wip-stuff at once when I made breaks). This is more like a proposal and a basis for discussion.
**Problem**:
This PR adds support for tab completions. See #397
**Solution**:
The general idea: For each application, there is a user-friendly config file ([RON](https://github.com/ron-rs/ron/)-format) which defines different types of command line parameters, etc. Currently supported features:
- boolean flags (e.g. `--version`)
- paths
- files with specific file extensions
- numbers
- key=value
- string (aka "everything else that takes custom values") with support for options (predefined list of possible values)
If an application has no completion-config, the default file file completer is used.
**Changes introduced by this pull request**:
- New dependencies: libflate, ron, serde
- A new completer (`IonCmdCompleter`) was created, similar to the existing `IonFileCompleter`
- When the user hits tab twice and the application (first word on the command line) has a completion defined, it is examined for possible matches.
- I've added a base ("empty") config file as well as two (unfinished) configs for `cargo` and `git`.
**Drawbacks**:
- I don't know if my code structure/architecture is fine, as I figured out how liner works as I worked on this, so the code may be restructured more cleanly?
- Also, I had to add an unsafe (https://gitlab.redox-os.org/BafDyce/ion/blob/adb13743757078f021614e89a8820958ea15203e/src/lib/shell/completer.rs#L71) to satisfy the borrow checker. Don't know if this can be avoided by restructuring.
- Aliases (different names for the same application) are not handled/implemented yet.
- Tab completions don't work when using the absolute path
- For both issues we would need some efficient HashMap-like data structure to map multiple keys to the same value
**TODOs**:
- [x] Discuss whether such a config-file based solution is wanted. `mmstick seems to be OK with it!? ;)`
- [ ] Add support for "dynamic" parameters (list of completions generated at runtime by executing an `ion` script?)
- [ ] Add support for "scheme" parameters
- [ ] Decide where to save the config files -> `ION_CONFIG_DIR/completions/`
- [ ] Add hook for installation script
- [ ] ~~Adapt initialization code accordingly~~ Implement lazy-loading functionality
- [x] Fix issue: auto-complete does not work if the cursor is on the right edge of a completed parameter (no space is inserted afterwards) `Fixed by recent liner upgrade`
- [ ] Cleanup the code, Add comments
- [ ] Rebase onto current master and fix merge conflicts
- [x] Add a new builtin for (re)loading completions at runtime
- [ ] Implement parsers to import completions:
- [x] From man-pages
- [ ] Improve parsing capabilities (subcommands, detect & filter invalid parsed files)
- [ ] Test on Redox (currently only on Linux tested)
- [ ] Add a bunch of completion configs.
- [ ] Add completions for ion builtins
- [ ] CI: Add validation of supplied completion files (just check whether they can be parsed correctly)
- [ ] rustmft
- [ ] clippy
- [ ] Bug fixes
**Fixes**: #397
**State**: WIP
**Blocking/related**: None that I know of.
**Other**:
I'm open for feedback, however I'll also be busy in the next days.
**Edit 2018-06-17**: Update text to match current state of MR