From 102c7d884bdd909d2ec33a958206e97c29fb64ca Mon Sep 17 00:00:00 2001 From: Jakub Grabarczuk Date: Wed, 28 Aug 2024 15:15:37 +0200 Subject: [PATCH] Completions for dotnet (#938) Just forwarding the work to "dotnet complete" command, which has a disadvantage of not including any comments --- custom-completions/dotnet/README.md | 14 ++++++++++++++ custom-completions/dotnet/dotnet-completions.nu | 7 +++++++ 2 files changed, 21 insertions(+) create mode 100644 custom-completions/dotnet/README.md create mode 100644 custom-completions/dotnet/dotnet-completions.nu diff --git a/custom-completions/dotnet/README.md b/custom-completions/dotnet/README.md new file mode 100644 index 0000000..c94a9a1 --- /dev/null +++ b/custom-completions/dotnet/README.md @@ -0,0 +1,14 @@ +# .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 + +- [Installation instructions](https://learn.microsoft.com/en-us/dotnet/core/install/), +- [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). diff --git a/custom-completions/dotnet/dotnet-completions.nu b/custom-completions/dotnet/dotnet-completions.nu new file mode 100644 index 0000000..7f2287c --- /dev/null +++ b/custom-completions/dotnet/dotnet-completions.nu @@ -0,0 +1,7 @@ +def "nu-complete dotnet" [prefix: string] { + ^dotnet complete $"($prefix)" | lines +} + +export extern "dotnet" [ + ...command: string@"nu-complete dotnet" +]