Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Belle2019-09-27 11:54:01 +0000
committerJan Belle2019-09-27 12:08:19 +0000
commitc1230cb269bcae2750648c1afe27c8ba5acc7b0c (patch)
treeb63ad68500d4238668b6293c773d0eca0aa70dc8
parent95ed7880f6542578133a3ebbfdf3ff4b504ede33 (diff)
downloadorg.eclipse.etrice-c1230cb269bcae2750648c1afe27c8ba5acc7b0c.tar.gz
org.eclipse.etrice-c1230cb269bcae2750648c1afe27c8ba5acc7b0c.tar.xz
org.eclipse.etrice-c1230cb269bcae2750648c1afe27c8ba5acc7b0c.zip
[common] Mark documentation rule as deprecated
Add quickfix that removes deprecated documentation strings. Bug 540720 Change-Id: I5e86d68b45d76b0972e66a6d9767765a3326cd28
-rw-r--r--plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/quickfix/BaseQuickfixProvider.xtend10
-rw-r--r--plugins/org.eclipse.etrice.core.common/src/org/eclipse/etrice/core/common/validation/BaseJavaValidator.java3
-rw-r--r--plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.xtend2
-rw-r--r--tests/org.eclipse.etrice.abstractexec.behavior.tests/models/bug417433.room15
4 files changed, 23 insertions, 7 deletions
diff --git a/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/quickfix/BaseQuickfixProvider.xtend b/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/quickfix/BaseQuickfixProvider.xtend
index 27b80c4ff..c264aa1be 100644
--- a/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/quickfix/BaseQuickfixProvider.xtend
+++ b/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/quickfix/BaseQuickfixProvider.xtend
@@ -25,6 +25,7 @@ import org.eclipse.xtext.ui.editor.quickfix.Fix
import org.eclipse.xtext.ui.editor.quickfix.IssueResolutionAcceptor
import org.eclipse.xtext.util.StringInputStream
import org.eclipse.xtext.validation.Issue
+import org.eclipse.etrice.core.common.base.Documentation
//import org.eclipse.xtext.ui.editor.quickfix.Fix
//import org.eclipse.xtext.ui.editor.quickfix.IssueResolutionAcceptor
@@ -73,9 +74,16 @@ class BaseQuickfixProvider extends DefaultQuickfixProvider {
IDE.openEditor(PlatformUI.workbench.activeWorkbenchWindow.activePage, file)
]
}
-
}
}
+
+ @Fix(BaseJavaValidator.DEPRECATED_DOCUMENTATION)
+ def void removeDeprecatedDocStrings(Issue issue, IssueResolutionAcceptor acceptor) {
+ acceptor.acceptMulti(issue, "Remove documentation string", "Remove deprecated documentation string", null, [Documentation doc |
+ doc.eContainer.eSet(doc.eContainingFeature, null)
+ ])
+
+ }
// @Fix(MyDslValidator::INVALID_NAME)
// def capitalizeName(Issue issue, IssueResolutionAcceptor acceptor) {
diff --git a/plugins/org.eclipse.etrice.core.common/src/org/eclipse/etrice/core/common/validation/BaseJavaValidator.java b/plugins/org.eclipse.etrice.core.common/src/org/eclipse/etrice/core/common/validation/BaseJavaValidator.java
index 24fa257ed..b3d2177e9 100644
--- a/plugins/org.eclipse.etrice.core.common/src/org/eclipse/etrice/core/common/validation/BaseJavaValidator.java
+++ b/plugins/org.eclipse.etrice.core.common/src/org/eclipse/etrice/core/common/validation/BaseJavaValidator.java
@@ -57,6 +57,7 @@ public class BaseJavaValidator extends org.eclipse.etrice.core.common.validation
public static final String DEPRECATED_IMPORT_URI = "BaseJavaValidator.DeprecatedImportUri";
public static final String MODELPATH_DESCRIPTION_MISSING = "BaseJavaValidator.ModelpathDescriptionMissing";
public static final String IMPORTED_NAMESPACE_MISSING = "BaseJavaValidator.ImportedNamespaceMissing";
+ public static final String DEPRECATED_DOCUMENTATION = "BaseJavaValidator.DeprecatedDocumentation";
@Inject ImportUriResolver importUriResolver;
@Inject ImportHelpers importHelpers;
@@ -64,6 +65,7 @@ public class BaseJavaValidator extends org.eclipse.etrice.core.common.validation
@Check
public void checkDocumentation(Documentation doc) {
+ warning("Explicit documentation strings are deprecated. Use javadoc/doxy style documentation strings instead.", doc, null, DEPRECATED_DOCUMENTATION);
if (doc.getLines().isEmpty())
error("documentation must not be empty", doc, BasePackage.Literals.DOCUMENTATION__LINES);
}
@@ -264,4 +266,5 @@ public class BaseJavaValidator extends org.eclipse.etrice.core.common.validation
}
}
}
+
}
diff --git a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.xtend b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.xtend
index 8a45b4507..fb95c7829 100644
--- a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.xtend
+++ b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.xtend
@@ -871,7 +871,7 @@ class DocuPostprocessor {
cls.getAttribute("multiplicity").setDocumentation(
'''
- Ports with multiplicity >1 are called relay ports. A multiplicity of {@code -1} means replicated
+ Ports with multiplicity >1 are called replicated ports. A multiplicity of {@code -1} means replicated
port with arbitrary multiplicity.
''')
diff --git a/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/bug417433.room b/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/bug417433.room
index 7b3173a47..b66f1f498 100644
--- a/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/bug417433.room
+++ b/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/bug417433.room
@@ -1,7 +1,9 @@
-/*
+/**
* stripped down example of https://bugs.eclipse.org/417433
+ *
+ * Generated from France IDL model org.franca.examples by Franca2ETriceTransformation.
*/
-RoomModel org.franca.examples [ "Generated from Franca IDL model org.franca.examples by Franca2ETriceTransformation." ]
+RoomModel org.franca.examples
{
ActorClass RobotArmExampleClient {
Interface {
@@ -49,9 +51,12 @@ RoomModel org.franca.examples [ "Generated from Franca IDL model org.franca.exam
Message release()
}
outgoing {
- Message replyMove(Boolean) [ "reply for move" ]
- Message replyGrab(Boolean) [ "reply for grab" ]
- Message replyRelease(Boolean) [ "reply for release" ]
+ /** reply for move */
+ Message replyMove(Boolean)
+ /** reply for grab */
+ Message replyGrab(Boolean)
+ /** reply for release */
+ Message replyRelease(Boolean)
Message operable(StructPosition)
}
semantics {

Back to the top