The completion engine maps completion locations to spans on a line, which
indicate whther to complete a command name, flag name, argument, and so on.
Initial implementation is simplistic, with some rough edges, since it relies
heavily on the parser's interpretation. For example
du -
if asking for completions, `-` is considered a positional argument by the
parser, but the user is likely looking for a flag. These scenarios will be
addressed in a series of progressive enhancements to the engine.
* Add deserialization of Primitive::Duration; Fixes#2373
* Implement Sleep command
* Add comment saying you should name your rest field "rest"
* Fix typo
* Add documentation for sleep command
* created text_color and line_color functions with hopes of theming soon.
* added text_color and line_color to hastableproperties
* Refactor Tractor.
* more refactoring
* make sort-by fail gracefully if mismatched types are compared
* Added a test to check if sorted-by with invalid types exists gracefully
* Linter changes
* removed redundant pattern matching
* Changed the error message
* Added a comma after every argument
* Changed the test to accomodate the new err messages
* Err message for sort-by invalid types now shows the mismatched types
* Lints problems
* Changed unwrap to expect
* Modify testcase
* Run exitscript in the folder it was specified
* Update documentation
* Add comment
* Borrow instead of clone
* Does this just... work on windows?
* fmt
* as_str
* Collapse if by order of clippy
* Support windows
* fmt
* refactor tests
* fmt
* This time it will work on windows FOR SURE
* Remove debug prints
* Comment
* Refactor tests
* fmt
* fix spelling
* update comment
* added various case conversion commands for str. Added the inflection crate as a dependency
* lighten the restriction on the inflector dependency
* publishing the case commands
* fix typo
* fix kebab case test
* formatting
The initial configuration refactoring already gave significant benefits
with my use case. On another note, Commands should know and ask for
configuration variables. We could, as we refactor, add the ability
for commands to tell what configuration variables knows about and
their types.
This way, completers can be used too when using `config` command if we
also add a sub command that config could set variables to.
Commands stating the config variables they know about will allow us
to implement it in `help` and display them.
* Changed time units as outlined in issue #2353.
Also applied changes to to_str for Unit - not sure if that was what was wanted.
* Forgot the tests!
* Updated primitive.rs to match changes.
* Updated where example to match changes.
* And the html test!
* Add commit to version command
* Replace unwrap with expect.
* Only have commit hash if git doesn't error
Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
* Remove `with-symlink-targets` flag from `ls`
* Fix test to use `ls -l` to output all the columns of `ls`
* Fix error message
* Delete test that originally covered `ls -w`
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
* Updated version hashing and bumped nu-cli to 0.18.1
* made code pertyer
* Update version.rs
* Update version.rs
Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
* Make history location configurable
Add history-path to your config if you want an alternate history file
location
* use IndexMap.get() instead of index
Co-authored-by: Amanita Muscaria <nope>
* add 228 json html themes
removed old assets, added new zipped asset
added --list to get a list of the theme names
reworked some older theme code
added rust-embed and zip crate
removed the dark tests
* fmt
* Updated, removed excess comments
Changed usage a bit
Updated the error handling
Added some helper items in --list
* removed rustyline config duplication
set other rustyline defaults if line_editor section doesn't exist
updated keyseq_timeout to -1 if emacs mode is chosen
* change checking rustyline config to if lets
* removed some unneccessary code
Refactored out most of internal work for summarizing data opening
the door for generating charts from it. A model is introduced
to hold information needed for a summary, Histogram command is
an example of a partial usage. This is the beginning.
Removed implicit arithmetic traits on Value and Primitive to avoid
mixed types panics. The std operations traits can't fail and we
can't guarantee that. We can handle gracefully now since compute_values
was introduced after the parser changes four months ago. The handling
logic should be taken care of either explicitly or in compute_values.
The zero identity trait was also removed (and implementing this forced
us to also implement Add, Mult, etc)
Also: the `math` operations now remove in the output if a given column is not computable:
```
> ls | math sum
──────┬──────────
size │ 150.9 KB
──────┴──────────
```
* Delete unnecessary match
* Use `unwrap_or_else()`
* Whitespace was trim on file save
* Use `map_or_else()`
* Use a default to group all match arms with same output
* Clippy made me do it
* Move lite_parse tests into a submodule
* Have lite_parse return partial parses when error encountered.
Although a parse fails, we can generally still return what was successfully
parsed. This is useful, for example, when figuring out completions at some
cursor position, because we can map the cursor to something more structured
(e.g., cursor is at a flag name).
* Add two further path cmds - type and exists
* Update type.rs
Try a more universal directory
* Update type.rs
Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
* Add new path commands
basename, expand and extension. Currently there is no real error
handling. expand returns the initial path if it didn't work, the others
return empty string
* Optionally apply to path
- Removing old code for dealing with escaping, since that has moved elsewhere.
- Eliminating some match statements in favour of result/option methods.
- Fix an issue where completing inside quotes could remove the quote at the
beginning, if one already existed on the line but the replacement didn't have
a quote at the beginning.
* Refactor all completion logic into `NuCompleter`
This is the next step to improving completions. Previously, completion logic was
scattered about (`FilesystemShell`, `NuCompleter`, `Helper`, and `ShellManager`).
By unifying the core logic into a central location, it will be easier to take the
next steps in improving completion.
* Update context.rs
Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
In any other shell, stderr is inherited like normal, and only piped if you
request it explicitly (e.g., `2>/dev/null`). In the case of a command like
`fzf`, stderr is used for the interactive selection of files. By piping it,
something like
fzf | xargs echo
does not work. By removing all stderr piping we eliminate this issue. We can
return later with a way to deal with stderr piping when an actual use case
arises.
* added campbell theme to html colors
* updated test results. had to make change for ci.
* hopefully the last changes for this stupid test :)
* moved tests to html.rs
* remove unnecessary using statement.
* still fighting with tests and tests are winning.