Commit 93d1e7a1 authored by Daniel Honsel's avatar Daniel Honsel
Browse files

find enumerated type references as well

parent 8e5b8c04
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
      <settingRecursiveProcessing>true</settingRecursiveProcessing>
      <settingAbortOnError>true</settingAbortOnError>
      <loggingConfiguration>
        <showFullPath>true</showFullPath>
        <showFullPath>false</showFullPath>
        <showFilename>true</showFilename>
        <showMessageClass>true</showMessageClass>
        <showDetails>true</showDetails>
@@ -53,7 +53,7 @@
      <checkNoUnusedImports>true</checkNoUnusedImports>
      <checkNoUnusedFormalParameters>true</checkNoUnusedFormalParameters>
      <checkNoUnusedLocalDefinitions>true</checkNoUnusedLocalDefinitions>
      <checkNoLiterals>true</checkNoLiterals>
      <checkNoLiterals>false</checkNoLiterals>
      <checkTypesAndValuesModuleContainmentCheck>true</checkTypesAndValuesModuleContainmentCheck>
      <checkTemplatesModuleContainmentCheck>true</checkTemplatesModuleContainmentCheck>
      <checkFunctionsModuleContainmentCheck>true</checkFunctionsModuleContainmentCheck>
+13 −15
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ import org.eclipse.xtext.validation.EValidatorRegistrar

import static extension de.ugoe.cs.swe.common.TTCN3ScopeHelper.*
import static extension org.eclipse.xtext.EcoreUtil2.*
import de.ugoe.cs.swe.tTCN3.EnumDefNamed

class CheckDefinitionComeFirstParameter {
	public boolean hasOtherDefinitions
@@ -556,30 +557,27 @@ class CodeStyleValidator extends AbstractDeclarativeValidator {
				if (body.structured.recordOf != null && body.structured.recordOf instanceof RecordOfDefNamed) {
					notReferenced = body.structured.recordOf.isUnreferenced(parentModule)
					detailDef = body.structured.recordOf as RecordOfDefNamed
				}
				if (body.structured.setOf != null && body.structured.setOf instanceof SetOfDefNamed) {
				} else if (body.structured.setOf != null && body.structured.setOf instanceof SetOfDefNamed) {
					notReferenced = body.structured.setOf.isUnreferenced(parentModule)
					detailDef = body.structured.setOf as SetOfDefNamed
				}
				if (body.structured.record != null && body.structured.record instanceof RecordDefNamed) {
				} else if (body.structured.record != null && body.structured.record instanceof RecordDefNamed) {
					notReferenced = body.structured.record.isUnreferenced(parentModule)
					detailDef = body.structured.record as RecordDefNamed
				}
				if (body.structured.union != null && body.structured.union instanceof UnionDefNamed) {
				} else if (body.structured.union != null && body.structured.union instanceof UnionDefNamed) {
					notReferenced = body.structured.union.isUnreferenced(parentModule)
					detailDef = body.structured.union as UnionDefNamed
				}
				if (body.structured.set != null && body.structured.set instanceof SetDefNamed) {
				} else if (body.structured.set != null && body.structured.set instanceof SetDefNamed) {
					notReferenced = body.structured.set.isUnreferenced(parentModule)
					detailDef = body.structured.set as SetDefNamed
				}
				if (body.structured.port != null && body.structured.port instanceof PortDef) {
				} else if (body.structured.port != null && body.structured.port instanceof PortDef) {
					notReferenced = body.structured.port.isUnreferenced(parentModule)
					detailDef = body.structured.port as PortDef
				}
				if (body.structured.component != null && body.structured.component instanceof ComponentDef) {
				} else if (body.structured.component != null && body.structured.component instanceof ComponentDef) {
					notReferenced = body.structured.component.isUnreferenced(parentModule)
					detailDef = body.structured.component as ComponentDef
				} else if (body.structured.enumDef != null && body.structured.enumDef instanceof EnumDefNamed) {
					notReferenced = body.structured.enumDef.isUnreferenced(parentModule)
					detailDef = body.structured.enumDef as EnumDefNamed
				}
			} else if (body.sub != null) {
				if (body.sub instanceof SubTypeDefNamed) {