Skip to content

Commit

Permalink
[fix] 修复指定codeStyle=xxx后,出现找不到none的错误
Browse files Browse the repository at this point in the history
  • Loading branch information
pirunxi committed Oct 19, 2023
1 parent 0603e9f commit 914adc0
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/Luban.Core/CodeFormat/CodeFormatManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ public class CodeFormatManager
private static readonly ILogger s_logger = LogManager.GetCurrentClassLogger();

public static CodeFormatManager Ins { get; } = new ();

private readonly Dictionary<string, ICodeStyle> _codeStyles = new();


public ICodeStyle NoneCodeStyle { get; private set; }
Expand Down Expand Up @@ -58,10 +56,7 @@ public ICodeStyle GetCodeStyle(string codeStyleName)

public void RegisterCodeStyle(string name, ICodeStyle codeStyle)
{
if (!_codeStyles.TryAdd(name, codeStyle))
{
s_logger.Error("code style:{} exists", name);
}
CustomBehaviourManager.Ins.RegisterBehaviour(typeof(CodeStyleAttribute), name, 0, () => codeStyle);
}

public ICodeStyle RegisterCodeStyle(string name, string namespaceNamingConvention, string typeNamingConvention,
Expand Down

0 comments on commit 914adc0

Please sign in to comment.