Skip to content

Commit

Permalink
Merge pull request #188 from ZenUml/fix-settings-not-saved-zen-277
Browse files Browse the repository at this point in the history
Fix settings not saved zen 277
  • Loading branch information
MrCoder authored Nov 9, 2021
2 parents ab721fa + dcb90ba commit aeff623
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
15 changes: 3 additions & 12 deletions resource/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<idea-plugin>
<id>com.zenuml.jetbrains</id>
<name>ZenUML support</name>
<version>2021.11</version>
<version>2021.11.9</version>
<idea-version since-build="212.5457.46"/>
<vendor url="http://www.zenuml.com">ZenUML</vendor>MarkdownSplitEditor

Expand All @@ -23,21 +23,12 @@ Includes the following features:</p>

<change-notes><![CDATA[
<ul>
<!-- <li>-->
<!-- <strong>Java Converter</strong>-->
<!-- <ul>-->
<!-- <li>-->
<!-- <strong>Fix issue on creating anonymous object:</strong>-->
<!-- <pre><em> Java: new Runnable() { ... } => DSL: new Runnable()</em></pre>-->
<!-- </li>-->
<!-- </ul>-->
<!-- </li>-->
<li>
<strong>DSL Preview</strong>
<ul>
<li>
<strong>New preview appearance for darcula theme</strong>
<!-- <pre><em> Java: new Runnable() { ... } => DSL: new Runnable()</em></pre>-->
<strong>New preview appearance for try-catch-finally</strong>
<pre> DSL: try {} catch(Exception) {} finally {}</pre>
</li>
</ul>
</li>
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/com/zenuml/dsl/PsiToDslConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public void visitTryStatement(PsiTryStatement statement) {

@Override
public void visitCatchSection(PsiCatchSection section) {
String parameter = section.getParameter().getText();
String parameter = section.getParameter().getType().getPresentableText();
zenDsl.append(String.format("catch(%s)", parameter.replace('|', ','))); //Parser doesn't support the pipe(|) character
super.visitCatchSection(section);
}
Expand Down
10 changes: 9 additions & 1 deletion test/data/simpleMessage/SimpleMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,15 @@ public void method_with_generic_type_in_method_param() {
public void method_with_try_catch() {
try {
foo();
} catch (Exception e) {
} catch (Exception1024 e) {
bar();
}
}

public void method_with_try_catch_annotated() {
try {
foo();
} catch (@Deprecated Exception1024 e) {
bar();
}
}
Expand Down
10 changes: 7 additions & 3 deletions test/src/com/zenuml/converter/SimpleMessageZenUmlTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,19 @@ public void test_method_with_generic_type_in_method_param() {
}

public void test_method_with_try_catch() {
testDslConversion("method_with_try_catch", "SimpleMessage.method_with_try_catch() {\n\ttry {\n\t\tfoo();\n\t}\n\tcatch(Exception e) {\n\t\tbar();\n\t}\n}\n");
testDslConversion("method_with_try_catch", "SimpleMessage.method_with_try_catch() {\n\ttry {\n\t\tfoo();\n\t}\n\tcatch(Exception1024) {\n\t\tbar();\n\t}\n}\n");
}

public void test_method_with_try_catch_annotated() {
testDslConversion("method_with_try_catch_annotated", "SimpleMessage.method_with_try_catch_annotated() {\n\ttry {\n\t\tfoo();\n\t}\n\tcatch(Exception1024) {\n\t\tbar();\n\t}\n}\n");
}

public void test_method_with_try_catch_throw() {
testDslConversion("method_with_try_catch_throw", "SimpleMessage.method_with_try_catch_throw() {\n\ttry {\n\t\tfoo();\n\t}\n\tcatch(Exception e) {\n\t\tthrow(new MyException());\n\t}\n}\n");
testDslConversion("method_with_try_catch_throw", "SimpleMessage.method_with_try_catch_throw() {\n\ttry {\n\t\tfoo();\n\t}\n\tcatch(Exception) {\n\t\tthrow(new MyException());\n\t}\n}\n");
}

public void test_method_with_try_catch_finally() {
testDslConversion("method_with_try_catch_finally", "SimpleMessage.method_with_try_catch_finally() {\n\ttry {\n\t\tfoo();\n\t}\n\tcatch(Exception1 e) {\n\t\thandleException1();\n\t}\n\tcatch(Exception2 , Exception3 e) {\n\t\thandleExceptions();\n\t}\n\tfinally {\n\t\tcleanup();\n\t}\n}\n");
testDslConversion("method_with_try_catch_finally", "SimpleMessage.method_with_try_catch_finally() {\n\ttry {\n\t\tfoo();\n\t}\n\tcatch(Exception1) {\n\t\thandleException1();\n\t}\n\tcatch(Exception2 , Exception3) {\n\t\thandleExceptions();\n\t}\n\tfinally {\n\t\tcleanup();\n\t}\n}\n");
}

public void test_method_that_throws_exceptions() {
Expand Down

0 comments on commit aeff623

Please sign in to comment.