mirror of
https://github.com/nushell/nushell.git
synced 2025-02-22 21:41:26 +01:00
f46f8b286b
6528 Commits
Author | SHA1 | Message | Date | |
---|---|---|---|---|
|
f46f8b286b
|
refactor(parser): use var_id for most constants in ResolvedImportPattern (#14920)
# Description This PR replaces most of the constants in `ResolvedImportPattern` from values to VarIds, this has benefits of: 1. less duplicated variables in state 2. precise span of variable, for example when calling `goto def` on a const imported by the `use` command, this allows it to find the original definition, instead of where the `use` command is. Note that the logic is different here for nested submodules, not all values are flattened and propagated to the outmost record variable, but I didn't find any differences in real world usage. I noticed that it was changed from `VarId` to `Value` in #10049. Maybe @kubouch can find some edge cases where this PR fails to work as expected. In my view, the record constants for `ResolvedImportPattern` should even reduced to single entry, if not able to get rid of. # User-Facing Changes # Tests + Formatting # After Submitting |
||
|
f88ed6ecd5
|
Fix improperly escaped strings in stor update (#14921)
# Description Fixes #14909 with the same technique used in #12820 for `stor insert`. Single quotes (and others) now work properly in strings passed to `stor update`. Also did some minor refactoring on `stor insert` so it matches the changes in `stor update`. # User-Facing Changes Bug-fix. # Tests + Formatting Test added for this scenario. - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🟢 `toolkit test` - 🟢 `toolkit test stdlib` # After Submitting N/A |
||
|
a011791631
|
Fallback to file completer in custom/external completer (#14781)
# Description Closes #14595. This modifies the behavior of both custom and external completers so that if the custom/external completer returns an invalid value, completions are suppressed and an error is logged. However, if the completer returns `null` (which this PR treats as a special value), we fall back to file completions. Previously, custom completers and external completers had different behavior. Any time an external completer returned an invalid value (including `null`), we would fall back to file completions. Any time a custom completer returned an invalid value (including `null`), we would suppress completions. I'm not too happy about the implementation, but it's the least intrusive way I could think of to do it. I added a `fallback` field to `CustomCompletions` that's checked after calling its `fetch()` method. If `fallback` is true, then we use file completions afterwards. An alternative would be to make `CustomCompletions` no longer implement the `Completer` trait, and instead have its `fetch()` method return an `Option<Vec<Suggestion>>`. But that resulted in a teeny bit of code duplication. # User-Facing Changes For those using an external completer, if they want to fall back to file completions on invalid values, their completer will have to explicitly return `null`. Returning `"foo"` or something will no longer make Nushell use file completions instead. For those making custom completers, they now have the option to fall back to file completions. # Tests + Formatting Added some tests and manually tested that if the completer returns an invalid value or the completer throws an error, that gets logged and completions are suppressed. # After Submitting The documentation for custom completions and external completers will have to be updated after this. |
||
|
c783b07d58
|
Remove unsued types (#14916)
# Description `Type::Block` and `Type::Signature` do not correspond to any `Value` cases and should be able to be removed. |
||
|
e3e2554b3d
|
Link to Blog in the welcome banner (#14914)
# Description With the fragmentation and proliferation of social media platforms, we're attempting to consolidate our news and official Nushell communications to: * The Nushell website, with updates posted on the Blog * Discord * GitHub This PR replaces Twitter with the Nushell Blog in the welcome banner. The other links were already available. # User-Facing Changes Welcome banner # Tests + Formatting # After Submitting |
||
|
926b0407c5
|
seq date : generalize to allow any duration for --increment argument (#14903)
<!-- if this PR closes one or more issues, you can automatically link the PR with them by using one of the [*linking keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword), e.g. - this PR should close #xxxx - fixes #xxxx you can also mention related issues, PRs or discussions! --> # Description <!-- Thank you for improving Nushell. Please, check our [contributing guide](../CONTRIBUTING.md) and talk to the core team before making major changes. Description of your pull request goes here. **Provide examples and/or screenshots** if your changes affect the user experience. --> This PR seeks to generalize the `seq date` command so that it can receive any duration as an `--increment`. Whereas the current command can only output a list of dates spaced at least 1 day apart, the new command can output a list of datetimes that are spaced apart by any duration. For example: ``` > seq date --begin-date 2025-01-01 --end-date 2025-01-02 --increment 6hr --output-format "%Y-%m-%d %H:%M:%S" ╭───┬─────────────────────╮ │ 0 │ 2025-01-01 00:00:00 │ │ 1 │ 2025-01-01 06:00:00 │ │ 2 │ 2025-01-01 12:00:00 │ │ 3 │ 2025-01-01 18:00:00 │ │ 4 │ 2025-01-02 00:00:00 │ ╰───┴─────────────────────╯ ``` Note that the default behavior remains unchanged: ``` > seq date --begin-date 2025-01-01 --end-date 2025-01-02 ╭───┬────────────╮ │ 0 │ 2025-01-01 │ │ 1 │ 2025-01-02 │ ╰───┴────────────╯ ``` The default output format also remains unchanged: ``` > seq date --begin-date 2025-01-01 --end-date 2025-01-02 --increment 6hr ╭───┬────────────╮ │ 0 │ 2025-01-01 │ │ 1 │ 2025-01-01 │ │ 2 │ 2025-01-01 │ │ 3 │ 2025-01-01 │ │ 4 │ 2025-01-02 │ ╰───┴────────────╯ ``` # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> ## Breaking Changes * The `--increment` argument no longer accepts just an integer and requires a duration ``` # NEW BEHAVIOR > seq date --begin-date 2025-01-01 --end-date 2025-01-02 --increment 1 Error: nu::parser::parse_mismatch × Parse mismatch during operation. ╭─[entry #13:1:68] 1 │ seq date --begin-date 2025-01-01 --end-date 2025-01-02 --increment 1 · ┬ · ╰── expected duration with valid units ╰──── ``` EDIT: Break Change is mitigated. `--increment` accepts either an integer or duration. ## Bug Fix * The `--days` argument had an off-by-one error and would print 1 too many elements in the output. For example, ``` # OLD BEHAVIOR > seq date -b 2025-01-01 --days 5 --increment 1 ╭───┬────────────╮ │ 0 │ 2025-01-01 │ │ 1 │ 2025-01-02 │ │ 2 │ 2025-01-03 │ │ 3 │ 2025-01-04 │ │ 4 │ 2025-01-05 │ │ 5 │ 2025-01-06 │ <-- Extra element ╰───┴────────────╯ # NEW BEHAVIOR > seq date -b 2025-01-01 --days 5 --increment 1day ╭───┬────────────╮ │ 0 │ 2025-01-01 │ │ 1 │ 2025-01-02 │ │ 2 │ 2025-01-03 │ │ 3 │ 2025-01-04 │ │ 4 │ 2025-01-05 │ ╰───┴────────────╯ ``` ## New Argument * A `--periods` argument is introduced to indicate the number of output elements, regardless of the `--increment` value. Importantly, the `--days` argument is ignored when `--periods` is set. ``` # NEW BEHAVIOR > seq date -b 2025-01-01 --days 5 --periods 10 --increment 1day ╭───┬────────────╮ │ 0 │ 2025-01-01 │ │ 1 │ 2025-01-02 │ │ 2 │ 2025-01-03 │ │ 3 │ 2025-01-04 │ │ 4 │ 2025-01-05 │ │ 5 │ 2025-01-06 │ │ 6 │ 2025-01-07 │ │ 7 │ 2025-01-08 │ │ 8 │ 2025-01-09 │ │ 9 │ 2025-01-10 │ ╰───┴────────────╯ ``` Note that the `--days` and `--periods` arguments differ in their functions. The `--periods` value determines the number of elements in the output that are always spaced `--increment` apart. The `--days` value determines the bookends `--begin-date` and `--end-date` when only one is set, though the number of elements may differ based on the `--increment` value. ``` # NEW BEHAVIOR > seq date -e 2025-01-01 --days 2 --increment 5hr --output-format "%Y-%m-%d %H:%M:%S" ╭───┬─────────────────────╮ │ 0 │ 2025-01-23 22:25:05 │ │ 1 │ 2025-01-24 03:25:05 │ │ 2 │ 2025-01-24 08:25:05 │ │ 3 │ 2025-01-24 13:25:05 │ │ 4 │ 2025-01-24 18:25:05 │ ╰───┴─────────────────────╯ ``` # Tests + Formatting <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use toolkit.nu; toolkit test stdlib"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> I added several examples for each user-facing change in `generators/seq_date.rs` and some tests in `tests/commands/seq_date.rs`. # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --> |
||
|
22a01d7e76
|
Use single atom for fuzzy matching (fix #14904) (#14913)
# Description Closes #14904. The bug there was introduced by #14846, which replaced skim with Nucleo. It turns out that Nucleo's `Pattern::new` function doesn't treat the needle as a single atom - it splits on spaces and makes each word its own atom. This PR fixes the problem by creating a single `Atom` for the whole needle rather than creating a `Pattern`. Because of the bug, when you typed `lines <TAB>` (with a space at the end), the suggestion `lines` was also matched. This suggestion was shorter than the original typed needle, which would cause an out-of-bounds error. This also meant that if you typed `foo bar<TAB>`, `foo aaaaa bar` would be shown before `foo bar aaa`. At the time, I didn't realize that it was more intuitive to have `foo bar aaa` be put first. # User-Facing Changes Typing something like `lines <TAB>` should no longer cause a panic. # Tests + Formatting - Added a test to ensure spaces are respected when fuzzy matching - Updated a test with the changed sort order for subcommand suggestions # After Submitting No need to update docs. |
||
|
299453ecb7
|
feat(lsp): better completion item documentation (#14905)
# Description This PR adds those markdown doc strings (previously only available via hover) to completion items: <img width="676" alt="image" src="https://github.com/user-attachments/assets/58c44d7d-4b49-4955-b3f0-fa7a727a8bc0" /> It also refactors a bit, primarily to prevent namespace pollution. # User-Facing Changes # Tests + Formatting # After Submitting |
||
|
fd684a204c
|
non-HTTP(s) URLs now works with start (#14370)
# Description this PR should close #14315 This PR enhances the start command in Nushell to handle both files and URLs more effectively, including support for custom URL schemes. Previously, the start command only reliably opened HTTP and HTTPS URLs, and custom schemes like Spotify and Obsidian which were not handled earlier. 1. **Custom URL Schemes Support:** - Added support for opening custom URL schemes 2. **Detailed Error Messages:** - Improved error reporting for failed external commands. - Captures and displays error output from the system to aid in debugging. **Example** **Opening a custom URL scheme (e.g., Spotify):** ```bash start spotify:track:4PTG3Z6ehGkBFwjybzWkR8?si=f9b4cdfc1aa14831 ``` Opens the specified track in the Spotify application. **User-Facing Changes** - **New Feature:** The start command now supports opening URLs with custom schemes |
||
|
cdbb3ee7b9
|
add version check command (#14880)
# Description This PR supersedes https://github.com/nushell/nushell/pull/14813 by making it a built-in command instead of checking for the latest version at some interval when nushell starts. This is what it looks like.  This example shows the output when the running version was 0.101.1-nightly.10  Description from old PR. One key functionality that I thought was interesting with this and that I worked with @hustcer on was to try and make sure it works with nightlies. So, it should tell you when there's a new nightly version that is available to download. This way, you can know about it without checking. What's key from a nightly perspective is (1) the tags are now semver compliant and (2) hustcer now updates the Cargo.toml package.version version number prior to compilation so you can know you're running a nightly version, and this PR uses that information to know whether to check the nightly repo or the nushell repo for updates. This uses the [update-informer](https://docs.rs/update-informer/latest/update_informer/) crate. NOTE that this _informs_ you of updates but does not automatically update. I kind of see this as the first step to eventually having an auto updater. There was caching of the version in the old PR since it ran on every nushell startup. Since this PR makes it a command and therefore always runs on-demand, I've removed the caching so that it always checks when you run it. # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> # Tests + Formatting <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use toolkit.nu; toolkit test stdlib"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --> |
||
|
f0f6b3a3e5
|
feat(lsp): document highlight (#14898)
<!-- if this PR closes one or more issues, you can automatically link the PR with them by using one of the [*linking keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword), e.g. - this PR should close #xxxx - fixes #xxxx you can also mention related issues, PRs or discussions! --> # Description <!-- Thank you for improving Nushell. Please, check our [contributing guide](../CONTRIBUTING.md) and talk to the core team before making major changes. Description of your pull request goes here. **Provide examples and/or screenshots** if your changes affect the user experience. --> This is a minor feature that highlights all occurrences of current variable/command in current file: <img width="346" alt="image" src="https://github.com/user-attachments/assets/f1078e79-d02e-480e-b84a-84efb222c9a4" /> Since this kind of request happens a lot with fixed document content, to avoid unnecessary parsing, this PR caches the `StateDelta` to the server. # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> Can be disabled on the client side. # Tests + Formatting <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use toolkit.nu; toolkit test stdlib"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> Implementation is directly borrowed from `references`, only one simple test case added. # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --> |
||
|
93e121782c
|
Improve and fix filesize formatting/display (#14397)
# Description This PR cleans up the code surrounding formatting and displaying file sizes. - The `byte_unit` crate we use for file size units displays kilobytes as `KB`, which is not the SI or ISO/IEC standard. Rather it should be `kB`, so this fixes #8872. On some systems, `KB` actually means `KiB`, so this avoids any potential confusion. - The `byte_unit` crate, when displaying file sizes, casts integers to floats which will lose precision for large file sizes. This PR adds a custom `Display` implementation for `Filesize` that can give an exact string representation of a `Filesize` for metric/SI units. - This PR also removes the dependency on the `byte_unit` crate which brought in several other dependencies. Additionally, this PR makes some changes to the config for filesize formatting (`$env.config.filesize`). - The previous filesize config had the `metric` and `format` options. If a metric (SI) unit was set in `format`, but `metric` was set to false, then the `metric` option would take precedence and convert `format` to the corresponding binary unit (or vice versa). E.g., `{ format: kB, metric: false }` => `KiB`. Instead, this PR adds the `unit` option to replace the `format` and `metric` options. `unit` can be set to a fixed file size unit like `kB` or `KiB`, or it can be set to one of the special options: `binary` or `metric`. These options tells nushell to format file sizes using an appropriately scaled metric or binary unit (examples below). ```nushell # precision = null # unit = kB 1kB # 1 kB 1KiB # 1.024 kB # unit = KiB 1kB # 0.9765625 KiB 1KiB # 1 KiB # unit = metric 1000B # 1 kB 1024B # 1.024 kB 10_000MB # 10 GB 10_240MiB # 10.73741824 GB # unit = binary 1000B # 1000 B 1024B # 1 KiB 10_000MB # 9.313225746154785 GiB 10_240MiB # 10 GiB ``` - In addition, this PR also adds the `precision` option to the filesize config. It determines how many digits to show after the decimal point. If set to null, then everything after the decimal point is shown. - The default filesize config is `{ unit: metric, precision: 1 }`. # User-Facing Changes - Commands that use the config to format file sizes will follow the changes described above (e.g., `table`, `into string`, `to text`, etc.). - The file size unit/format passed to `format filesize` is now case sensitive. An error with the valid units is shown if the case does not match. - `$env.config.filesize.format` and `$env.config.filesize.metric` are deprecated and replaced by `$env.config.filesize.unit`. - A new `$env.config.filesize.precision` option was added. # Tests + Formatting Mostly updated test expected outputs. # After Submitting This PR does not change the way NUON serializes file sizes, because that would require changing the nu parser to be able to losslessly decode the new, exact string representation introduced in this PR. Similarly, this PR also does not change the file size parsing in any way. Although the file size units provided to `format filesize` or the filesize config are now case-sensitive, the same is not yet true for file size literals in nushell code. |
||
|
befeddad59
|
Add correct path from data-dir (#14894)
Fix issue in #14879 with incorrect subdirectory. Before: Appended `vendor/autoload` After: Appends `nushell/vendor/autoload` |
||
|
73c08fcb2b
|
fix(parser): missing span of the entire block of a module file (#14889)
<!-- if this PR closes one or more issues, you can automatically link the PR with them by using one of the [*linking keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword), e.g. - this PR should close #xxxx - fixes #xxxx you can also mention related issues, PRs or discussions! --> # Description <!-- Thank you for improving Nushell. Please, check our [contributing guide](../CONTRIBUTING.md) and talk to the core team before making major changes. Description of your pull request goes here. **Provide examples and/or screenshots** if your changes affect the user experience. --> A simple method found by @tmillr to solve [this issue](https://github.com/nushell/nushell/discussions/14854) # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> # Tests + Formatting <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use toolkit.nu; toolkit test stdlib"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> I didn't find a suitable place in `nu-parser` to add the test case, placed in `nu-lsp` instead. # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --> |
||
|
9a0ae7c4c0
|
Fix #14842 (#14885)
Sorry was a little bit busy close #14842 I've added a test but I'd check if it solved it. cc: @fdncred __________________________ **Unrelated** Recently got a pretty good format idea (https://github.com/zhiburt/tabled/issues/472) Just wanna highlight that we could probably experiment with it, if it being a bit elaborated. It's sort of KV table which nushell already has, But it's more for a default table where each row/record being rendered as a KV table. It's not something super nice I guess but maybe it could get some appliance. So yes pointing it out just in case. Like these. ``` ┌──────────────┬───────────────────────────────────────────────┐ │ Field │ Value │ ├──────────────┼───────────────────────────────────────────────┤ │ Company │ INTEL CORP │ ├──────────────┼───────────────────────────────────────────────┤ │ Street │ 2200 MISSION COLLEGE BLVD, RNB-4-151 │ ├──────────────┼───────────────────────────────────────────────┤ │ City │ SANTA CLARA │ ├──────────────┼───────────────────────────────────────────────┤ │ ZIP code │ 95054 │ ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫ │ Company │ Apple Inc. │ ├──────────────┼───────────────────────────────────────────────┤ │ Street │ ONE APPLE PARK WAY │ ├──────────────┼───────────────────────────────────────────────┤ │ City │ CUPERTINO │ ├──────────────┼───────────────────────────────────────────────┤ │ ZIP code │ 95014 │ └──────────────┴───────────────────────────────────────────────┘ ┌──────────────────────────────────────────────────────────────┐ │ INTEL CORP │ ├──────────────┬───────────────────────────────────────────────┤ │ Street │ 2200 MISSION COLLEGE BLVD, RNB-4-151 │ ├──────────────┼───────────────────────────────────────────────┤ │ City │ SANTA CLARA │ ├──────────────┼───────────────────────────────────────────────┤ │ ZIP code │ 95054 │ ├──────────────┴───────────────────────────────────────────────┤ │ Apple Inc. │ ├──────────────┬───────────────────────────────────────────────┤ │ Street │ ONE APPLE PARK WAY │ ├──────────────┼───────────────────────────────────────────────┤ │ City │ CUPERTINO │ ├──────────────┼───────────────────────────────────────────────┤ │ ZIP code │ 95014 │ └──────────────┴───────────────────────────────────────────────┘ ``` PS: Now thinking about it, it's sort of like doing a iteration over rows and building a current KV table, Which is interesting cause we could do it row by row, in which case doing CTRLC would not ruin build but got some data rendered. All though it's a different kind of approach. Just saying. |
||
|
28ca0e7116
|
Bump similar from 2.6.0 to 2.7.0 (#14888)
Bumps [similar](https://github.com/mitsuhiko/similar) from 2.6.0 to 2.7.0. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/mitsuhiko/similar/blob/main/CHANGELOG.md">similar's changelog</a>.</em></p> <blockquote> <h2>2.7.0</h2> <ul> <li>Add optional support for <code>web-time</code> to support web WASM targets. <a href="https://redirect.github.com/mitsuhiko/similar/issues/73">#73</a></li> <li>Crate will no longer panic wheh deadlines are used in WASM. At worst deadlines are silently ignored. To enforce deadlines enable the <code>wasm32_web_time</code> feature. <a href="https://redirect.github.com/mitsuhiko/similar/issues/74">#74</a></li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
||
|
84c720daf5
|
fix(lsp): renaming of flag variables (#14890)
<!-- if this PR closes one or more issues, you can automatically link the PR with them by using one of the [*linking keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword), e.g. - this PR should close #xxxx - fixes #xxxx you can also mention related issues, PRs or discussions! --> # Description <!-- Thank you for improving Nushell. Please, check our [contributing guide](../CONTRIBUTING.md) and talk to the core team before making major changes. Description of your pull request goes here. **Provide examples and/or screenshots** if your changes affect the user experience. --> This PR fixes a bug: renaming on a flag variable removes the leading `--` in the signature. <img width="257" alt="image" src="https://github.com/user-attachments/assets/767c62de-f3a0-4a07-9786-61b21e8cfcb6" /> Gets the following before this PR: ```nushell export def foooo [ p: int ] { $p } ``` # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> # Tests + Formatting <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use toolkit.nu; toolkit test stdlib"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --> |
||
|
cdb082e92d
|
Improve example for epoch -> datetime (#14886)
Better example for `into datetime` with Unix epoch |
||
|
0666b3784f
|
Use $nu.data-dir as last directory for vendor autoloads on all platforms (#14879)
# Description Should fix #14872. ## Before The vendor autoload code in #13382 used `dirs::data_dir()` (from the `dirs` crate), leading to a different behavior when `XDG_DATA_HOME` is set on each platform. * On Linux, the `dirs` crate automatically uses `XDG_DATA_HOME` for `dirs::data_dir()`, so everything worked as expected. * On macOS, `dirs` doesn't use the XDG spec, but the vendor autoload code from #13382 specifically added `XDG_DATA_HOME`. However, even if `XDG_DATA_HOME` was set, vendor autoloads would still use the `dirs` version *as well*. * On Windows, `XDG_DATA_HOME` was ignored completely by vendor autoloads, even though `$nu.data-dirs` was respecting it. ## After This PR uses `nu::data_dirs()` on all platforms. `nu::data_dirs()` respects `XDG_DATA_HOME` (if set) on all platforms. # User-Facing Changes Might be a breaking change if someone was depending on the old behavior, but the doc already specified the behavior in this PR. |
||
|
379d89369c
|
into cell-path : noop when input is cell-path (#14881)
<!-- if this PR closes one or more issues, you can automatically link the PR with them by using one of the [*linking keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword), e.g. - this PR should close #xxxx - fixes #xxxx you can also mention related issues, PRs or discussions! --> # Description <!-- Thank you for improving Nushell. Please, check our [contributing guide](../CONTRIBUTING.md) and talk to the core team before making major changes. Description of your pull request goes here. **Provide examples and/or screenshots** if your changes affect the user experience. --> https://github.com/nushell/nushell/pull/14845#issuecomment-2596371878 When the input to `into cell-path` is a cell-path, it will return it like other into commands. # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> Before, using `into cell-path` with a cell-path as input would return an error, now it will return the input. <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use toolkit.nu; toolkit test stdlib"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --> |
||
|
2bd345c367
|
into glob : noop when input is glob (#14882)
<!-- if this PR closes one or more issues, you can automatically link the PR with them by using one of the [*linking keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword), e.g. - this PR should close #xxxx - fixes #xxxx you can also mention related issues, PRs or discussions! --> # Description <!-- Thank you for improving Nushell. Please, check our [contributing guide](../CONTRIBUTING.md) and talk to the core team before making major changes. Description of your pull request goes here. **Provide examples and/or screenshots** if your changes affect the user experience. --> https://github.com/nushell/nushell/pull/14845#issuecomment-2596371878 When the input to `into glob` is a glob, it will return it like other into commands. # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> Before, using `into glob` with a glob as input would return an error, now it will return the input. <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use toolkit.nu; toolkit test stdlib"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --> |
||
|
0e418688d4
|
Rename fmt to format number (#14875)
# Description This PR renames `fmt` to `format number`, to bring it in line with similar value formatting commands and make it more discoverable. # User-Facing Changes * The `fmt` command is now `format number`. A deprecation warning will be thrown if you use `fmt`. # Tests + Formatting - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🟢 `toolkit test` - 🟢 `toolkit test stdlib` # After Submitting N/A |
||
|
b97d89adb6
|
Fix retrieval of config directory for user autoloads (#14877)
# Description Fixes an issue with #14669 - I mistakenly used `dirs::config_dir()` when it should be `nu_path::config_dir()`. This allows `XDG_CONFIG_DIR` to specify the location properly. # User-Facing Changes Fix: If `XDG_CONFIG_DIR` is set, it will be used for the `autoload` location. # Tests + Formatting - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🟢 `toolkit test` - 🟢 `toolkit test stdlib` # After Submitting N/A |
||
|
ee84435a0e
|
fix(lsp): missing references in use command (#14861)
<!-- if this PR closes one or more issues, you can automatically link the PR with them by using one of the [*linking keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword), e.g. - this PR should close #xxxx - fixes #xxxx you can also mention related issues, PRs or discussions! --> # Description <!-- Thank you for improving Nushell. Please, check our [contributing guide](../CONTRIBUTING.md) and talk to the core team before making major changes. Description of your pull request goes here. **Provide examples and/or screenshots** if your changes affect the user experience. --> This PR fixes the issue of the missing references in `use` command <img width="832" alt="image" src="https://github.com/user-attachments/assets/f67cd4b3-2e50-4dda-b2ed-c41aee86d3e9" /> However, as described in [this discussion](https://github.com/nushell/nushell/discussions/14854), the returned reference list is still not complete due to the inconsistent IDs. As a side effect, `hover/goto def` now also works on the `use` command arguments <img width="752" alt="image" src="https://github.com/user-attachments/assets/e0abdc9e-097a-44c2-9084-8d7905ae1d5e" /> Actions including `goto def/hover/references/rename` now work with module (maybe some edge cases of `overlay` are not covered) <img width="571" alt="image" src="https://github.com/user-attachments/assets/b4edb9b7-1540-4c52-bf8b-145bc6a1ad4a" /> # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> # Tests + Formatting <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use toolkit.nu; toolkit test stdlib"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> Added 1. the test for heavy requests cancellation. 2. expected Edit for the missing ref of `use` to the existing rename test. 3. `goto/hover` on module name # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --> |
||
|
3f5ebd75b6
|
feat(lsp): cancellable heavy requests (#14851)
<!-- if this PR closes one or more issues, you can automatically link the PR with them by using one of the [*linking keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword), e.g. - this PR should close #xxxx - fixes #xxxx you can also mention related issues, PRs or discussions! --> # Description <!-- Thank you for improving Nushell. Please, check our [contributing guide](../CONTRIBUTING.md) and talk to the core team before making major changes. Description of your pull request goes here. **Provide examples and/or screenshots** if your changes affect the user experience. --> `tower-lsp` seems not well-maintained, I ended up with a dedicated thread for heavy computing and message passing to cancel it on any new request. During the progress, interrupting with edits or new requests. <img width="522" alt="image" src="https://github.com/user-attachments/assets/b263d73d-8ea3-4b26-a7b7-e0b30462d1af" /> Goto references are still blocking, with a hard timeout of 5 seconds. Only locations found within the time limit are returned. Technically, reference requests allow for responses with partial results, which means instant responsiveness. However, the `lsp_types` crate hasn’t enabled this. I believe I can still enable it with some JSON manipulation, but I’ll leave it for future work. # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> # Tests + Formatting <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use toolkit.nu; toolkit test stdlib"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> Need some clever way to test the cancellation, no test cases added yet. # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --> |
||
|
75105033b2
|
Use nucleo instead of skim for completions (#14846)
# Description This PR replaces `SkimMatcherV2` from the [fuzzy-matcher](https://docs.rs/fuzzy-matcher/latest/fuzzy_matcher/) crate with the [nucleo-matcher](https://docs.rs/nucleo-matcher/latest/nucleo_matcher/) crate for doing fuzzy matching. This touches both our completion code in `nu-cli` and symbol filtering in `nu-lsp`. Nucleo should give us better performance than Skim. In the event that we decide to use the Nucleo frontend ([crate docs](https://docs.rs/nucleo/latest/nucleo/)) too, it also works on Windows, unlike [Skim](https://github.com/skim-rs/skim), which appears to only support Linux and MacOS. Unfortunately, we still have an indirect dependency on `fuzzy-matcher`, because the [`dialoguer`](https://github.com/console-rs/dialoguer) crate uses it. # User-Facing Changes No breaking changes. Suggestions will be sorted differently, because Nucleo uses a different algorithm from Skim for matching/scoring. Hopefully, the new sorting will generally make more sense. # Tests + Formatting In `nu-cli`, modified an existing test, but didn't test performance. I haven't tested `nu-lsp` manually, but existing tests pass. I did manually do `ls /nix/store/<TAB>`, `ls /nix/store/d<TAB>`, etc., but didn't notice Nucleo being faster (my `/nix/store` folder has 34136 items at the time of writing). |
||
|
8759936636
|
Fix variable names that end in a duration suffix can't be on the right part of a range (#14848)
# Description Fixes: #14844 The issue occurs when nushell is parsing a value with `SyntaxShape::Any`, it checks `Duration` and `Filesize` first, then `Range`. Nushell raises errors too early while parsing `Duration/Filesize`. This pr changes the order of parsing to fix the issue. # User-Facing Changes The following code should be able to run after this pr ```nushell let runs = 10; 1..$runs ``` # Tests + Formatting Added 2 tests, one for filesize, one for duration. # After Submitting NaN |
||
|
4dcaf2a201
|
Rename/deprecate range to slice (#14825)
# Description As the `range` command has an ambiguous name (does it construct a range type?, does it iterate a range like `seq`) replace it with a more descriptive verb of what it does: `slice` Closes #14130 # User-Facing Changes `range` is now deprecated and replaced in whole by `slice` with the same behavior. `range` will be removed in `0.103.0` # Tests + Formatting Tests have been updated to use `slice` # After submitting - [ ] prepare PR for `nu_scripts` (several usages of `range` to be fixed) - [ ] update documentation usages of `range` after release |
||
|
089c5221cc
|
Add new operators has and not-has (#14841)
# Description This PR add 2 new operators, `has` and `not-has`. They are basically `in` and `not-in` with the order of operands swapped. Motivation for this was the awkward way of searching for rows that contain an item using `where` ```nushell [[name, children]; [foo, [a, b, c]], [bar [d, e, f]]] | where ("e" in $it.children) ``` vs ```nushell [[name, children]; [foo, [a, b, c]], [bar [d, e, f]]] | where children has "e" ``` # User-Facing Changes Added `has` and `not-has` operators, mirroring `in` and `not-in`. # Tests + Formatting - 🟢 toolkit fmt - 🟢 toolkit clippy - 🟢 toolkit test - 🟢 toolkit test stdlib # After Submitting |
||
|
0587308684
|
into datetime : noop when input is a datetime (#14845)
# Description - Closes #14839 When the input to `into datetime` is a datetime, it will return it like other `into` commands. # User-Facing Changes Before, using `into datetime` with a datetime as input would return an error, now it will return the input. # Tests + Formatting Added test `takes_datetime`. # After Submitting Doc file is automatically generated. |
||
|
6eff420e17
|
fix error propagation in export-env (#14847)
- fixes #14801 # Description - Fixed the issue - Added some comments mirroring the ones used in `export-env` handling in `use` - Added two tests to prevent regressions # User-Facing Changes # Tests + Formatting - 🟢 toolkit fmt - 🟢 toolkit clippy - 🟢 toolkit test - 🟢 toolkit test stdlib # After Submitting |
||
|
d66f8cca40
|
feat(lsp): workspace wide operations: rename/goto references (#14837)
# Description <!-- Thank you for improving Nushell. Please, check our [contributing guide](../CONTRIBUTING.md) and talk to the core team before making major changes. Description of your pull request goes here. **Provide examples and/or screenshots** if your changes affect the user experience. --> <!-- if this PR closes one or more issues, you can automatically link the PR with them by using one of the [*linking keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword), e.g. - this PR should close #xxxx - fixes #xxxx you can also mention related issues, PRs or discussions! --> goto reference: <img width="885" alt="image" src="https://github.com/user-attachments/assets/6f85cd10-0c2d-46b2-b99e-47a9bbf90822" /> rename: <img width="483" alt="image" src="https://github.com/user-attachments/assets/828e7586-c2b7-414d-9085-5188b10f5f5f" /> Caveats: 1. Module reference/rename is not supported yet 2. names in `use` command should also be renamed, which is not handled now 3. workspace wide actions can be time-consuming, as it requires parsing of all `**/*.nu` files in the workspace (if its text contains the name). Added a progress bar for such requests. 4. In case these requests are triggered accidentally in a root folder with a large depth, I hard-coded the max depth to search to 5 right now. # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> # Tests + Formatting <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use toolkit.nu; toolkit test stdlib"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> Limited test cases # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --> |
||
|
06938659d2
|
Remove required positional arguments from run-external and exec (#14765)
# Description This PR removes the required positional argument from `run-external` and `exec` in favor of the rest arguments, meaning lists of external commands can be spread directly into `run-external` and `exec`. This does have the drawback of making calling `run-external` and `exec` with no arguments a run-time error rather than a parse error, but I don't imagine that is an issue. Before (for both `run-external` and `exec`): ```nushell run-external # => Error: nu::parser::missing_positional # => # => × Missing required positional argument. # => ╭─[entry #9:1:13] # => 1 │ run-external # => ╰──── # => help: Usage: run-external <command> ...(args) . Use `--help` for more # => information. let command = ["cat" "hello.txt"] run-external ...$command # => Error: nu::parser::missing_positional # => # => × Missing required positional argument. # => ╭─[entry #11:1:14] # => 1 │ run-external ...$command # => · ▲ # => · ╰── missing command # => ╰──── # => help: Usage: run-external <command> ...(args) . Use `--help` for more # => information. run-external ($command | first) ...($command | skip 1) # => hello world! ``` After (for both `run-external` and `exec`): ```nushell run-external # => Error: nu:🐚:missing_parameter # => # => × Missing parameter: no command given. # => ╭─[entry #2:1:1] # => 1 │ run-external # => · ──────┬───── # => · ╰── missing parameter: no command given # => ╰──── # => let command = ["cat" "hello.txt"] run-external ...$command # => hello world! ``` # User-Facing Changes Lists can now be spread directly into `run-external` and `exec`: ```nushell let command = [cat hello.txt] run-external ...$command # => hello world! ``` # Tests + Formatting - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🟢 `toolkit test` - 🟢 `toolkit test stdlib` # After Submitting N/A |
||
|
46566296c0
|
Use non-canonicalized paths in shell integrations (#14832)
This simply replaces uses of the deprecated function `current_dir_str` with `EngineState::cwd_as_string` in `run_shell_integration_*` functions. The main difference being that the latter does not canonicalize paths. Fixes #14619 |
||
|
b99a8c9d80
|
Bump tokio from 1.42.0 to 1.43.0 (#14829)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.42.0 to 1.43.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/tokio-rs/tokio/releases">tokio's releases</a>.</em></p> <blockquote> <h2>Tokio v1.43.0</h2> <h1>1.43.0 (Jan 8th, 2025)</h1> <h3>Added</h3> <ul> <li>net: add <code>UdpSocket::peek</code> methods (<a href="https://redirect.github.com/tokio-rs/tokio/issues/7068">#7068</a>)</li> <li>net: add support for Haiku OS (<a href="https://redirect.github.com/tokio-rs/tokio/issues/7042">#7042</a>)</li> <li>process: add <code>Command::into_std()</code> (<a href="https://redirect.github.com/tokio-rs/tokio/issues/7014">#7014</a>)</li> <li>signal: add <code>SignalKind::info</code> on illumos (<a href="https://redirect.github.com/tokio-rs/tokio/issues/6995">#6995</a>)</li> <li>signal: add support for realtime signals on illumos (<a href="https://redirect.github.com/tokio-rs/tokio/issues/7029">#7029</a>)</li> </ul> <h3>Fixed</h3> <ul> <li>io: don't call <code>set_len</code> before initializing vector in <code>Blocking</code> (<a href="https://redirect.github.com/tokio-rs/tokio/issues/7054">#7054</a>)</li> <li>macros: suppress <code>clippy::needless_return</code> in <code>#[tokio::main]</code> (<a href="https://redirect.github.com/tokio-rs/tokio/issues/6874">#6874</a>)</li> <li>runtime: fix thread parking on WebAssembly (<a href="https://redirect.github.com/tokio-rs/tokio/issues/7041">#7041</a>)</li> </ul> <h3>Changes</h3> <ul> <li>chore: use unsync loads for <code>unsync_load</code> (<a href="https://redirect.github.com/tokio-rs/tokio/issues/7073">#7073</a>)</li> <li>io: use <code>Buf::put_bytes</code> in <code>Repeat</code> read impl (<a href="https://redirect.github.com/tokio-rs/tokio/issues/7055">#7055</a>)</li> <li>task: drop the join waker of a task eagerly (<a href="https://redirect.github.com/tokio-rs/tokio/issues/6986">#6986</a>)</li> </ul> <h3>Changes to unstable APIs</h3> <ul> <li>metrics: improve flexibility of H2Histogram Configuration (<a href="https://redirect.github.com/tokio-rs/tokio/issues/6963">#6963</a>)</li> <li>taskdump: add accessor methods for backtrace (<a href="https://redirect.github.com/tokio-rs/tokio/issues/6975">#6975</a>)</li> </ul> <h3>Documented</h3> <ul> <li>io: clarify <code>ReadBuf::uninit</code> allows initialized buffers as well (<a href="https://redirect.github.com/tokio-rs/tokio/issues/7053">#7053</a>)</li> <li>net: fix ambiguity in <code>TcpStream::try_write_vectored</code> docs (<a href="https://redirect.github.com/tokio-rs/tokio/issues/7067">#7067</a>)</li> <li>runtime: fix <code>LocalRuntime</code> doc links (<a href="https://redirect.github.com/tokio-rs/tokio/issues/7074">#7074</a>)</li> <li>sync: extend documentation for <code>watch::Receiver::wait_for</code> (<a href="https://redirect.github.com/tokio-rs/tokio/issues/7038">#7038</a>)</li> <li>sync: fix typos in <code>OnceCell</code> docs (<a href="https://redirect.github.com/tokio-rs/tokio/issues/7047">#7047</a>)</li> </ul> <p><a href="https://redirect.github.com/tokio-rs/tokio/issues/6874">#6874</a>: <a href="https://redirect.github.com/tokio-rs/tokio/pull/6874">tokio-rs/tokio#6874</a> <a href="https://redirect.github.com/tokio-rs/tokio/issues/6963">#6963</a>: <a href="https://redirect.github.com/tokio-rs/tokio/pull/6963">tokio-rs/tokio#6963</a> <a href="https://redirect.github.com/tokio-rs/tokio/issues/6975">#6975</a>: <a href="https://redirect.github.com/tokio-rs/tokio/pull/6975">tokio-rs/tokio#6975</a> <a href="https://redirect.github.com/tokio-rs/tokio/issues/6986">#6986</a>: <a href="https://redirect.github.com/tokio-rs/tokio/pull/6986">tokio-rs/tokio#6986</a> <a href="https://redirect.github.com/tokio-rs/tokio/issues/6995">#6995</a>: <a href="https://redirect.github.com/tokio-rs/tokio/pull/6995">tokio-rs/tokio#6995</a> <a href="https://redirect.github.com/tokio-rs/tokio/issues/7014">#7014</a>: <a href="https://redirect.github.com/tokio-rs/tokio/pull/7014">tokio-rs/tokio#7014</a> <a href="https://redirect.github.com/tokio-rs/tokio/issues/7029">#7029</a>: <a href="https://redirect.github.com/tokio-rs/tokio/pull/7029">tokio-rs/tokio#7029</a> <a href="https://redirect.github.com/tokio-rs/tokio/issues/7038">#7038</a>: <a href="https://redirect.github.com/tokio-rs/tokio/pull/7038">tokio-rs/tokio#7038</a> <a href="https://redirect.github.com/tokio-rs/tokio/issues/7041">#7041</a>: <a href="https://redirect.github.com/tokio-rs/tokio/pull/7041">tokio-rs/tokio#7041</a> <a href="https://redirect.github.com/tokio-rs/tokio/issues/7042">#7042</a>: <a href="https://redirect.github.com/tokio-rs/tokio/pull/7042">tokio-rs/tokio#7042</a> <a href="https://redirect.github.com/tokio-rs/tokio/issues/7047">#7047</a>: <a href="https://redirect.github.com/tokio-rs/tokio/pull/7047">tokio-rs/tokio#7047</a> <a href="https://redirect.github.com/tokio-rs/tokio/issues/7053">#7053</a>: <a href="https://redirect.github.com/tokio-rs/tokio/pull/7053">tokio-rs/tokio#7053</a> <a href="https://redirect.github.com/tokio-rs/tokio/issues/7054">#7054</a>: <a href="https://redirect.github.com/tokio-rs/tokio/pull/7054">tokio-rs/tokio#7054</a> <a href="https://redirect.github.com/tokio-rs/tokio/issues/7055">#7055</a>: <a href="https://redirect.github.com/tokio-rs/tokio/pull/7055">tokio-rs/tokio#7055</a></p> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
||
|
b34547334a
|
Bump data-encoding from 2.6.0 to 2.7.0 (#14831)
Bumps [data-encoding](https://github.com/ia0/data-encoding) from 2.6.0 to 2.7.0. <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/ia0/data-encoding/commits">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
d9bfcb4c09
|
Bump uuid from 1.11.0 to 1.12.0 (#14830)
Bumps [uuid](https://github.com/uuid-rs/uuid) from 1.11.0 to 1.12.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/uuid-rs/uuid/releases">uuid's releases</a>.</em></p> <blockquote> <h2>1.12.0</h2> <h2>What's Changed</h2> <ul> <li>feat: Add <code>NonZeroUuid</code> type for optimized <code>Option<Uuid></code> representation by <a href="https://github.com/ab22593k"><code>@ab22593k</code></a> in <a href="https://redirect.github.com/uuid-rs/uuid/pull/779">uuid-rs/uuid#779</a></li> <li>Finalize <code>NonNilUuid</code> by <a href="https://github.com/KodrAus"><code>@KodrAus</code></a> in <a href="https://redirect.github.com/uuid-rs/uuid/pull/783">uuid-rs/uuid#783</a></li> <li>Prepare for 1.12.0 release by <a href="https://github.com/KodrAus"><code>@KodrAus</code></a> in <a href="https://redirect.github.com/uuid-rs/uuid/pull/784">uuid-rs/uuid#784</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/ab22593k"><code>@ab22593k</code></a> made their first contribution in <a href="https://redirect.github.com/uuid-rs/uuid/pull/779">uuid-rs/uuid#779</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/uuid-rs/uuid/compare/1.11.1...1.12.0">https://github.com/uuid-rs/uuid/compare/1.11.1...1.12.0</a></p> <h2>1.11.1</h2> <h2>What's Changed</h2> <ul> <li>Finish cut off docs by <a href="https://github.com/KodrAus"><code>@KodrAus</code></a> in <a href="https://redirect.github.com/uuid-rs/uuid/pull/777">uuid-rs/uuid#777</a></li> <li>Fix links in CONTRIBUTING.md by <a href="https://github.com/jacobggman"><code>@jacobggman</code></a> in <a href="https://redirect.github.com/uuid-rs/uuid/pull/778">uuid-rs/uuid#778</a></li> <li>Update rust toolchain before building by <a href="https://github.com/KodrAus"><code>@KodrAus</code></a> in <a href="https://redirect.github.com/uuid-rs/uuid/pull/781">uuid-rs/uuid#781</a></li> <li>Prepare for 1.11.1 release by <a href="https://github.com/KodrAus"><code>@KodrAus</code></a> in <a href="https://redirect.github.com/uuid-rs/uuid/pull/782">uuid-rs/uuid#782</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/jacobggman"><code>@jacobggman</code></a> made their first contribution in <a href="https://redirect.github.com/uuid-rs/uuid/pull/778">uuid-rs/uuid#778</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/uuid-rs/uuid/compare/1.11.0...1.11.1">https://github.com/uuid-rs/uuid/compare/1.11.0...1.11.1</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
||
|
8ce14a7c86
|
replace icons in grid with devicons + color (#14827)
# Description This PR replaces the home-grown icons in the `grid` command with the `devicons` crate. ### Before  ### After  # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> # Tests + Formatting <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use toolkit.nu; toolkit test stdlib"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --> |
||
|
301d1370c4
|
Add input support to generate (#14804)
- closes #8523 # Description This PR adds pipeline input support to `generate`. - Without input, `generate` keeps its current behavior. - With input, each invocation of the closure is provided an item from the input stream as pipeline input (`$in`). If/when the input stream runs out, `generate` also stops. Before this PR, there is no filter command that is both stateful _and_ streaming. This PR also refactors `std/iter scan` to use `generate`, making it streaming and more performant over larger inputs. # User-Facing Changes - `generate` now supports pipeline input, passing each element to the closure as `$in` until it runs out - `std/iter scan` is now streaming # Tests + Formatting Added tests to validate the new feature. - 🟢 toolkit fmt - 🟢 toolkit clippy - 🟢 toolkit test - 🟢 toolkit test stdlib # After Submitting N/A |
||
|
306e305b65
|
Add help pipe-and-redirect command. (#14821)
# Description This pr is going to add a new command named `help pipe-and-redirect`. So user can detect such feature easier. # User-Facing Changes Here is the output of this command: ``` ╭───┬────────┬──────────────────────────────────────┬──────────────────────────────────────────────────────────────┬─────────────────────╮ │ # │ symbol │ name │ description │ example │ ├───┼────────┼──────────────────────────────────────┼──────────────────────────────────────────────────────────────┼─────────────────────┤ │ 0 │ | │ pipe │ pipeline stdout of a command to another command │ ^cmd1 | ^cmd2 │ │ 1 │ e>| │ stderr pipe │ pipeline stderr of a command to another command │ ^cmd1 e>| ^cmd2 │ │ 2 │ o+e>| │ stdout and stderr pipe │ pipeline stdout and stderr of a command to another command │ ^cmd1 o+e>| ^cmd2 │ │ 3 │ o> │ redirection │ redirect stdout of a command, overwriting a file │ ^cmd1 o> file.txt │ │ 4 │ e> │ stderr redirection │ redirect stderr of a command, overwriting a file │ ^cmd1 e> file.txt │ │ 5 │ o+e> │ stdout and stderr redirection │ redirect stdout and stderr of a command, overwriting a file │ ^cmd1 o+e> file.txt │ │ 6 │ o>> │ redirection append │ redirect stdout of a command, appending to a file │ ^cmd1 o> file.txt │ │ 7 │ e>> │ stderr redirection append │ redirect stderr of a command, appending to a file │ ^cmd1 e> file.txt │ │ 8 │ o+e>> │ stdout and stderr redirection append │ redirect stdout and stderr of a command, appending to a file │ ^cmd1 o+e> file.txt │ │ 9 │ o>| │ │ Unsupported, it's the same to `|`, use it instead │ │ ├───┼────────┼──────────────────────────────────────┼──────────────────────────────────────────────────────────────┼─────────────────────┤ │ # │ symbol │ name │ description │ example │ ╰───┴────────┴──────────────────────────────────────┴──────────────────────────────────────────────────────────────┴─────────────────────╯ ``` # Tests + Formatting # After Submitting Should update more examples in [nushell doc](https://www.nushell.sh/lang-guide/chapters/pipelines.html) to fill more examples |
||
|
e117706518
|
fix(parser): span of $it /$in set to the first character of its scope (#14817)
<!-- if this PR closes one or more issues, you can automatically link the PR with them by using one of the [*linking keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword), e.g. - this PR should close #xxxx - fixes #xxxx you can also mention related issues, PRs or discussions! --> # Description <!-- Thank you for improving Nushell. Please, check our [contributing guide](../CONTRIBUTING.md) and talk to the core team before making major changes. Description of your pull request goes here. **Provide examples and/or screenshots** if your changes affect the user experience. --> Follow-up PR of #14789 The span of `$it/$in` is set to a 0-width one with start/end pointing to the start of its scope, mainly for error messages positioning. # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> # Tests + Formatting <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use toolkit.nu; toolkit test stdlib"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --> |
||
|
737ea3940e
|
finish removing terminal_size dep (#14819)
# Description This PR is a follow on to https://github.com/nushell/nushell/pull/14423 and finishes removing the `terminal_size` crate in favor of `crossterm`'s `size()`. # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> # Tests + Formatting <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use toolkit.nu; toolkit test stdlib"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --> |
||
|
e5337b50a9
|
fix(lsp): goto definition on variables in match guard (#14818)
<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx
you can also mention related issues, PRs or discussions!
-->
# Description
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.
Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->
This PR fixes a corner case of goto definition in lsp server.
```nushell
let foo = 1
match $foo {
_ if $foo == 1 => 1
# |_______________ goto definition does not work here
_ => 2
}
```
Since `match_pattern.guard` is not handled in this function (which could
be another issue).
|
||
|
23dc1b600a
|
feat(lsp): inlay hints of types in assignments (#14809)
<!-- if this PR closes one or more issues, you can automatically link the PR with them by using one of the [*linking keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword), e.g. - this PR should close #xxxx - fixes #xxxx you can also mention related issues, PRs or discussions! --> # Description <!-- Thank you for improving Nushell. Please, check our [contributing guide](../CONTRIBUTING.md) and talk to the core team before making major changes. Description of your pull request goes here. **Provide examples and/or screenshots** if your changes affect the user experience. --> This is a complementary PR of #14802 <img width="418" alt="image" src="https://github.com/user-attachments/assets/ddf945e4-7ef0-4c73-a9fd-e68591efce03" /> # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> # Tests + Formatting <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use toolkit.nu; toolkit test stdlib"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> new relative test cases # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --> |
||
|
f05162811c
|
Implementing ByteStream interuption on infinite stream (#13552)
# Description This PR should address #13530 by explicitly handling ByteStreams. The issue can be replicated easily on linux by running: ```nushell open /dev/urandom | into binary | bytes at ..10 ``` Would leave the output hanging and with no way to cancel it, this was likely because it was trying to collect the input stream and would not complete. I have also put in an error to say that using negative offsets for a bytestream without a length cannot be used. ```nushell ~/git/nushell> open /dev/urandom | into binary | bytes at (-1).. Error: nu:🐚:incorrect_value × Incorrect value. ╭─[entry #3:1:35] 1 │ open /dev/urandom | into binary | bytes at (-1).. · ────┬─── ───┬── · │ ╰── encountered here · ╰── Negative range values cannot be used with streams that don't specify a length ╰──── ``` # User-Facing Changes No operation changes, only the warning you get back for negative offsets # Tests + Formatting Ran `toolkit check pr ` with no errors or warnings Manual testing of the example commands above --------- Co-authored-by: Ian Manske <ian.manske@pm.me> Co-authored-by: Simon Curtis <simon.curtis@candc-uk.com> |
||
|
0b71eb201c
|
fix(lsp): PWD env_var (#14805)
<!-- if this PR closes one or more issues, you can automatically link the PR with them by using one of the [*linking keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword), e.g. - this PR should close #xxxx - fixes #xxxx you can also mention related issues, PRs or discussions! --> # Description <!-- Thank you for improving Nushell. Please, check our [contributing guide](../CONTRIBUTING.md) and talk to the core team before making major changes. Description of your pull request goes here. **Provide examples and/or screenshots** if your changes affect the user experience. --> This PR fixes an issue introduced by #14770 , as shown in https://github.com/nushell/nushell/pull/14802#issuecomment-2585270161 # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> # Tests + Formatting <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use toolkit.nu; toolkit test stdlib"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --> |
||
|
707ab1df6a
|
bump to rust version 1.82 (#14795)
# Description The PR follows our standard of bumping the rust compiler when a new one is released. /cc @ayax79 @sholderbach # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> # Tests + Formatting <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use toolkit.nu; toolkit test stdlib"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --> |
||
|
c811d86dbd
|
feat(lsp): inlay hints of variable types and command params (#14802)
<!-- if this PR closes one or more issues, you can automatically link the PR with them by using one of the [*linking keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword), e.g. - this PR should close #xxxx - fixes #xxxx you can also mention related issues, PRs or discussions! --> # Description <!-- Thank you for improving Nushell. Please, check our [contributing guide](../CONTRIBUTING.md) and talk to the core team before making major changes. Description of your pull request goes here. **Provide examples and/or screenshots** if your changes affect the user experience. --> This PR adds inlay hints of variable types and parameter names to lsp-server <img width="547" alt="image" src="https://github.com/user-attachments/assets/07a0dd84-5ecc-47df-a8a7-732631715662" /> Some design choices I made: * for composite types like `record<foo: <record ...>>`, only a short name displayed. Full signature already available through `hover` * only parameter names of user defined commands are returned, feels too much distraction if enabled for all builtins * some information are lost in flattened expressions, so I implemented my AST traversing functions, which may seem unnecessary, but I can't find alternatives from the existing code. * another minor change: added a line separator to current hover markdown message. # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> Users who think this feature annoying now have to manually turn it off (or config the lsp client capabilities). # Tests + Formatting <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use toolkit.nu; toolkit test stdlib"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --> |
||
|
827e31191d
|
fix: unknown span for special variables $in/$it (#14789)
<!-- if this PR closes one or more issues, you can automatically link the PR with them by using one of the [*linking keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword), e.g. - this PR should close #xxxx - fixes #xxxx you can also mention related issues, PRs or discussions! --> # Description <!-- Thank you for improving Nushell. Please, check our [contributing guide](../CONTRIBUTING.md) and talk to the core team before making major changes. Description of your pull request goes here. **Provide examples and/or screenshots** if your changes affect the user experience. --> This PR addresses the issue of inconsistent spans of special variables of `$in/$in`, as discussed in https://github.com/nushell/nushell/pull/14770#discussion_r1908729364. Instead of making the `declaration_span` to be Option, which will cause too many changes that we may want to avoid, this PR set the spans to be `unknown`. # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> No # Tests + Formatting <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use toolkit.nu; toolkit test stdlib"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --> |
||
|
b9b3101bd9
|
Let table only check for use_ansi_coloring config value (#14798)
<!-- if this PR closes one or more issues, you can automatically link the PR with them by using one of the [*linking keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword), e.g. - this PR should close #xxxx - fixes #xxxx you can also mention related issues, PRs or discussions! --> # Description <!-- Thank you for improving Nushell. Please, check our [contributing guide](../CONTRIBUTING.md) and talk to the core team before making major changes. Description of your pull request goes here. **Provide examples and/or screenshots** if your changes affect the user experience. --> This PR removes the `std::io::stdout().is_terminal()` check in `table` again. To ensure that in the future this doesn't happen again, I added a comment and a test. # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> Resets the behavior of `table` to #14647 again, after #14415 included it again. # Tests + Formatting <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use toolkit.nu; toolkit test stdlib"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> Added a new test to check for these color outputs. - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🟢 `toolkit test` - 🟢 `toolkit test stdlib` # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --> |