From 914adc0879108fca3170aa5c42a85e44934a2b0e Mon Sep 17 00:00:00 2001 From: walon Date: Thu, 19 Oct 2023 15:53:23 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E4=BF=AE=E5=A4=8D=E6=8C=87=E5=AE=9Acod?= =?UTF-8?q?eStyle=3Dxxx=E5=90=8E=EF=BC=8C=E5=87=BA=E7=8E=B0=E6=89=BE?= =?UTF-8?q?=E4=B8=8D=E5=88=B0none=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Luban.Core/CodeFormat/CodeFormatManager.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Luban.Core/CodeFormat/CodeFormatManager.cs b/src/Luban.Core/CodeFormat/CodeFormatManager.cs index 8d57e332..5062deae 100644 --- a/src/Luban.Core/CodeFormat/CodeFormatManager.cs +++ b/src/Luban.Core/CodeFormat/CodeFormatManager.cs @@ -10,8 +10,6 @@ public class CodeFormatManager private static readonly ILogger s_logger = LogManager.GetCurrentClassLogger(); public static CodeFormatManager Ins { get; } = new (); - - private readonly Dictionary _codeStyles = new(); public ICodeStyle NoneCodeStyle { get; private set; } @@ -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,