Skip to content

Do not read a repeated tool name as an uninstalled one - #803

Merged
SimonCropp merged 1 commit into
mainfrom
fix-toolsorder-duplicate-throw
Aug 22, 2026
Merged

Do not read a repeated tool name as an uninstalled one#803
SimonCropp merged 1 commit into
mainfrom
fix-toolsorder-duplicate-throw

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

ToolsOrder.Sort looked each requested tool up in Definitions.Tools, which holds
every tool whether it is on the machine or not - so the lookup never failed for
a tool that was merely not installed, and throwForNoTool could not mean what it
said. What did make the lookup fail was a repeat, since the first occurrence
removed the definition from the list.

So DiffEngine_ToolOrder=VisualStudio,VisualStudio threw "is not installed" for a
tool that was, and it did so from DiffTools' static constructor - which makes it
permanent. Every later use of DiffTools in that process is a
TypeInitializationException, for a typo in an environment variable.

Distinct the order, since a repeated name is a typo and not a request for two.
And move the throw to InitTools, where being installed is actually decided,
keeping it to tools the caller named rather than to the remainder that is
appended anyway.

The first version of the duplicate test named VisualStudio and failed for the
right reason - it is not installed here - so it now picks an installed tool from
DiffTools.Resolved.

ToolsOrder.Sort looked each requested tool up in Definitions.Tools, which holds
every tool whether it is on the machine or not - so the lookup never failed for
a tool that was merely not installed, and throwForNoTool could not mean what it
said. What did make the lookup fail was a repeat, since the first occurrence
removed the definition from the list.

So DiffEngine_ToolOrder=VisualStudio,VisualStudio threw "is not installed" for a
tool that was, and it did so from DiffTools' static constructor - which makes it
permanent. Every later use of DiffTools in that process is a
TypeInitializationException, for a typo in an environment variable.

Distinct the order, since a repeated name is a typo and not a request for two.
And move the throw to InitTools, where being installed is actually decided,
keeping it to tools the caller named rather than to the remainder that is
appended anyway.

The first version of the duplicate test named VisualStudio and failed for the
right reason - it is not installed here - so it now picks an installed tool from
DiffTools.Resolved.
@SimonCropp
SimonCropp merged commit ae73cbb into main Aug 22, 2026
9 checks passed
@SimonCropp
SimonCropp deleted the fix-toolsorder-duplicate-throw branch August 22, 2026 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant