From 8e9d25ed4f39b05d0a3edee143301373d01c9886 Mon Sep 17 00:00:00 2001 From: Jan Klass Date: Sun, 16 Nov 2025 16:05:22 +0100 Subject: [PATCH 1/2] Extend dotnet completions documentation .NET 10 introduces `dotnet completions script nushell`. I took the opportunity to try and update the dotnet completions, to test if it works and what works, but ultimately concluded that it's incomplete/unusable as is. I updated the README.md with my findings. I assume `dotnet complete` is currently missing and will be extended with `dotnet completions` completions eventually. I'm not sure whether the current extern export is preferable over an external completer configuration, but it seems plausibly preferable to me, because it doesn't mix with other external completer configurations and is used earlier in the completion chain before falling back to external completers. If that is the case, the dotnet command generates suboptimal completion configuration. --- custom-completions/dotnet/README.md | 46 +++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/custom-completions/dotnet/README.md b/custom-completions/dotnet/README.md index c94a9a1cb..2b5872a23 100644 --- a/custom-completions/dotnet/README.md +++ b/custom-completions/dotnet/README.md @@ -1,6 +1,7 @@ # .NET CLI completions Completions for the .NET CLI (`dotnet`), which comes with .NET SDK. + .NET is, to quote the official documentation, an "open-source developer platform for building many different types of applications". For more information, see @@ -9,6 +10,45 @@ For more information, see - [CLI documentation](https://learn.microsoft.com/en-us/dotnet/core/tools/), - [General dotnet documentation](https://learn.microsoft.com/en-us/dotnet/fundamentals/). -This plugin uses built-in `dotnet complete` command, which unfortunately does not provide comments for the completions. -On the other hand, it is officially supported, and completions are always in sync with the installed .NET SDK. -For hand-crafted completions, see ones generated from Fish: (../auto-generate/completions/dotnet.nu). +## SDK dependency and Limitations + +This plugin uses built-in `dotnet complete` command. Unfortunately, it does not cover all capabilities of Nushell, like completion comments. +(See [capabilities](https://learn.microsoft.com/en-us/dotnet/core/tools/enable-tab-autocomplete#completion-capabilities).) + +Despite being the official, native, integrated completion mechanism, `dotnet complete` may not cover all commands. +For example, version 10.0.100 does not cover the new `dotnet completions` commands. + +For hand-crafted completions, see other completions like the ones generated from Fish located in (../auto-generate/completions/dotnet.nu). + +## .NET SDK 10 and `dotnet completions` + +From the .NET SDK version 10 onwards, the `dotnet` CLI offers `dotnet completions script nushell` that generaltes a Nushell external completer configuration. +Unfortunately, it is not directly pluggable, but more of a mix of generated forwarding completer and manual configuration integration guide: + +```nushell +# Add the following content to your config.nu file: + +let external_completer = { |spans| + { + dotnet: { || + dotnet complete ( + $spans | skip 1 | str join " " + ) | lines + } + } | get $spans.0 | each { || do $in } +} + +# And then in the config record, find the completions section and add the +# external_completer that was defined earlier to external: + +let-env config = { + # your options here + completions: { + # your options here + external: { + # your options here + completer: $external_completer # add it here + } + } +} +``` From 4439f695068125f7608f32d1f6ac6e5e87d61fdb Mon Sep 17 00:00:00 2001 From: Jan Klass Date: Sun, 16 Nov 2025 23:18:32 +0100 Subject: [PATCH 2/2] Drop outdated generated code block --- custom-completions/dotnet/README.md | 33 +++-------------------------- 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/custom-completions/dotnet/README.md b/custom-completions/dotnet/README.md index 2b5872a23..35139fe6a 100644 --- a/custom-completions/dotnet/README.md +++ b/custom-completions/dotnet/README.md @@ -22,33 +22,6 @@ For hand-crafted completions, see other completions like the ones generated from ## .NET SDK 10 and `dotnet completions` -From the .NET SDK version 10 onwards, the `dotnet` CLI offers `dotnet completions script nushell` that generaltes a Nushell external completer configuration. -Unfortunately, it is not directly pluggable, but more of a mix of generated forwarding completer and manual configuration integration guide: - -```nushell -# Add the following content to your config.nu file: - -let external_completer = { |spans| - { - dotnet: { || - dotnet complete ( - $spans | skip 1 | str join " " - ) | lines - } - } | get $spans.0 | each { || do $in } -} - -# And then in the config record, find the completions section and add the -# external_completer that was defined earlier to external: - -let-env config = { - # your options here - completions: { - # your options here - external: { - # your options here - completer: $external_completer # add it here - } - } -} -``` +From the .NET SDK version 10 onwards, the `dotnet` CLI offers `dotnet completions script nushell` which generaltes a Nushell external completer configuration, +but in an outdated format. +As such, it can not be used with current Nushell versions.