From 75572bd4b9d33d031a4483f5dda54638027bfee3 Mon Sep 17 00:00:00 2001 From: Fabio Zadrozny Date: Wed, 1 May 2024 15:01:40 -0300 Subject: [PATCH] Make it possible for FormatStd to be cloned. --- .../org/python/pydev/core/formatter/FormatStd.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/plugins/org.python.pydev.core/src/org/python/pydev/core/formatter/FormatStd.java b/plugins/org.python.pydev.core/src/org/python/pydev/core/formatter/FormatStd.java index 2dee364ef6..52f26526b2 100644 --- a/plugins/org.python.pydev.core/src/org/python/pydev/core/formatter/FormatStd.java +++ b/plugins/org.python.pydev.core/src/org/python/pydev/core/formatter/FormatStd.java @@ -5,7 +5,7 @@ * * @author Fabio */ -public class FormatStd { +public class FormatStd implements Cloneable { public enum FormatterEnum { PYDEVF, AUTOPEP8, BLACK, RUFF @@ -17,7 +17,7 @@ public enum FormatterEnum { public static final String RUFF = "RUFF"; public static FormatterEnum getFormatterEnumFromStr(String formatterStyleStr) { - switch (formatterStyleStr) { + switch (formatterStyleStr.toUpperCase()) { case AUTOPEP8: return FormatterEnum.AUTOPEP8; case BLACK: @@ -131,4 +131,13 @@ public void updateFormatterStyle() { } } + @Override + public FormatStd clone() { + try { + return (FormatStd) super.clone(); + } catch (CloneNotSupportedException e) { + throw new RuntimeException(e); + } + } + } \ No newline at end of file