`dotnet-suggest list` truncates dotted global tool names
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
FileEnumerator.cs の FileEnumerator.EnumerateFilesWithoutExtension と SuggestionDispatcher.cs の SuggestionDispatcher.ShellPrefixesToMatch から始め、それぞれが Linux の実行可能ファイル名をどのように扱うかを追跡し、関連するテストを確認してください。関連するテストを実行した後、dotnet-suggest list がドットを含むツール名を完全な形で保持し、PowerShell shim がそれらの補完機能を登録できることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
The tool names below are anonymized. They retain the same number of dotted segments as the original names.
Environment
- OS: Linux
dotnet-suggest: 3.0.0- Shell: PowerShell
Steps to reproduce
- Install a .NET global tool with a dotted command name, for example
Example.Tools.StatusMonitor.Console. - Verify that
dotnet tool list -gshows the full name in the Commands column. - Run
dotnet-suggest list.
Expected behavior
The list contains Example.Tools.StatusMonitor.Console, so the PowerShell shim can register a completer for the full command name.
Actual behavior
The list shows Example.Tools. A second tool, SampleUi.Automation.TestClient, appears as SampleUi.
Tab completion for the full name fails with the standard PowerShell shim. Passing the full executable path directly returns the expected options:
$name = 'Example.Tools.StatusMonitor.Console'
$exe = (Get-Command $name -CommandType Application).Source
$line = "$name --"
dotnet-suggest get -e $exe --position $line.Length -- $line
Explicitly registering the full name with Register-ArgumentCompleter -Native restores tab completion.
Likely cause
In v3.0.0, global-tool discovery calls Path.GetFileNameWithoutExtension in FileEnumerator.EnumerateFilesWithoutExtension, removing .Console from the Linux executable name. SuggestionDispatcher.ShellPrefixesToMatch calls the same method again when producing list output, removing .StatusMonitor. The PowerShell shim uses the resulting name to register the completer.
- FileEnumerator.cs in v3.0.0
- SuggestionDispatcher.cs in v3.0.0
- Related app-side registration issue #2316
Background
We use the same name for a C# project, its assembly, and its installed command. This makes it easier to trace a command in a deployment script or log back to the project that builds it. Our project names follow the dotted naming convention we use across our C# codebase, so preserving the dots in the command name is important to us.
- 主要言語
- C#
- スター
- 3.7k
- フォーク
- 439
- 平均マージ
- 4日 8時間
- マージ済み PR(30日)
- 9
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dotnet/command-line-api のほかの issue
-
German localization is incomplete対応中かも @b-v-d-e-v が 43 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
dotnet/command-line-api#2852 ·
メンテナーはふだん 3 日以内に返信
-
Incomplete French (fr) translation: RequiredOptionWasNotProvided not translated対応中かも @JPBlanc が 141 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
dotnet/command-line-api#2822 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
dotnet/command-line-api#2792 · コメント 2 件 · リアクション 17 件 ·
メンテナーはふだん 3 日以内に返信
-
`Argument.Arity` modify internal state on first get access.対応中かも @zjdangge が 27 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
dotnet/command-line-api#2704 ·
メンテナーはふだん 3 日以内に返信
-
GetCompletions should check exit code of invoked application対応中かも @baradgur が 1312 日前に担当しました。 オープンArea-Completions bug help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
dotnet/command-line-api#2137 · コメント 1 件 · リアクション 3 件 ·
メンテナーはふだん 3 日以内に返信
dotnet/command-line-api の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
area:repo elsa 3 prio low triaged type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
elsa-workflows/elsa-core#9258 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
iokode/OpinionatedFramework#140 ·
-
accessibility effort: small enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pedersebastian/CustomBossChallenge#185 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100