Skip to content

Commit

Permalink
Don't warn for $schema element (#6927)
Browse files Browse the repository at this point in the history
Adding a `$schema` attribute pointing to the official schema is a nice way to get completion in an editor. This caused a warning during build, however.

This checks for that element when building the commands so we don't warn for what is already a supported scenario.

Fixes Using $schema to get completion causes a build warning #6926
  • Loading branch information
kzu committed Dec 23, 2020
1 parent 624b7ce commit 3af5ec5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/docfx/SubCommands/CompositeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

namespace Microsoft.DocAsCode.SubCommands
{
using System;
using System.Collections.Generic;
using System.Linq;

Expand All @@ -26,7 +27,10 @@ public CompositeCommand(string[] args, ISubCommandController controller, Composi
{
if (!controller.TryGetCommandCreator(pair.Key, out ISubCommandCreator command))
{
Logger.LogWarning($"{pair.Key} is not a recognized command name, ignored.");
if (!pair.Key.Equals("$schema", StringComparison.Ordinal))
{
Logger.LogWarning($"{pair.Key} is not a recognized command name, ignored.");
}
}
else
{
Expand Down

0 comments on commit 3af5ec5

Please sign in to comment.