diff --git a/yang-lsp/io.typefox.yang.diagram/.settings/org.eclipse.core.resources.prefs b/yang-lsp/io.typefox.yang.diagram/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000..99f26c02 --- /dev/null +++ b/yang-lsp/io.typefox.yang.diagram/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/yang-lsp/io.typefox.yang/src/main/java/io/typefox/yang/processor/YangProcessor.java b/yang-lsp/io.typefox.yang/src/main/java/io/typefox/yang/processor/YangProcessor.java index 26360a80..bd8bde82 100644 --- a/yang-lsp/io.typefox.yang/src/main/java/io/typefox/yang/processor/YangProcessor.java +++ b/yang-lsp/io.typefox.yang/src/main/java/io/typefox/yang/processor/YangProcessor.java @@ -166,9 +166,9 @@ private void processChildren(Statement statement, HasStatements parent, FeatureE child = new ElementData((SchemaNode) ele, ElementKind.Grouping); } else if (ele instanceof Uses) { /* - * The effect of a “uses” reference to a grouping is that the nodes defined by + * The effect of a "uses" reference to a grouping is that the nodes defined by * the grouping are copied into the current schema tree and are then updated - * according to the “refine” and “augment” statements. + * according to the "refine" and "augment" statements. */ GroupingRef groupingRef = ((Uses) ele).getGrouping(); Grouping grouping = groupingRef.getNode(); diff --git a/yang-lsp/io.typefox.yang/src/test/java/io/typefox/yang/tests/serializer/Bug224Test.xtend b/yang-lsp/io.typefox.yang/src/test/java/io/typefox/yang/tests/serializer/Bug224Test.xtend index de23c5b3..661ba99d 100644 --- a/yang-lsp/io.typefox.yang/src/test/java/io/typefox/yang/tests/serializer/Bug224Test.xtend +++ b/yang-lsp/io.typefox.yang/src/test/java/io/typefox/yang/tests/serializer/Bug224Test.xtend @@ -8,6 +8,7 @@ import org.eclipse.xtext.resource.SaveOptions import org.eclipse.xtext.resource.XtextResource import org.eclipse.xtext.util.EmfFormatter import org.junit.Test +import static extension org.eclipse.xtext.util.Strings.toPlatformLineSeparator import static org.junit.Assert.assertEquals @@ -101,7 +102,7 @@ class Bug224Test extends AbstractYangTest { } }''' assertEquals(expectedResolvedPath, - EmfFormatter.objToStr((augmentsLeafType.substatements.head as Path).reference)) + EmfFormatter.objToStr((augmentsLeafType.substatements.head as Path).reference).toPlatformLineSeparator) val serializer = (sub2Res as XtextResource).getSerializer(); val result = serializer.serialize(submodule2, SaveOptions.newBuilder().format().getOptions()) diff --git a/yang-lsp/io.typefox.yang/src/test/java/io/typefox/yang/tests/serializer/Bug225Test.xtend b/yang-lsp/io.typefox.yang/src/test/java/io/typefox/yang/tests/serializer/Bug225Test.xtend index bc0dd702..d48f0a7b 100644 --- a/yang-lsp/io.typefox.yang/src/test/java/io/typefox/yang/tests/serializer/Bug225Test.xtend +++ b/yang-lsp/io.typefox.yang/src/test/java/io/typefox/yang/tests/serializer/Bug225Test.xtend @@ -8,7 +8,7 @@ import org.eclipse.xtext.resource.SaveOptions import org.eclipse.xtext.resource.XtextResource import org.eclipse.xtext.util.EmfFormatter import org.junit.Test - +import static extension org.eclipse.xtext.util.Strings.toPlatformLineSeparator import static org.junit.Assert.assertEquals class Bug225Test extends AbstractYangTest { @@ -129,7 +129,7 @@ class Bug225Test extends AbstractYangTest { } }''' assertEquals(expectedResolvedPath, - EmfFormatter.objToStr((augmentsLeafType.substatements.head as Path).reference)) + EmfFormatter.objToStr((augmentsLeafType.substatements.head as Path).reference).toPlatformLineSeparator) val result = serializer.serialize(submodule2, SaveOptions.newBuilder().format().getOptions()) assertEquals(''' diff --git a/yang-lsp/io.typefox.yang/src/test/java/io/typefox/yang/tests/serializer/SerializationTest.xtend b/yang-lsp/io.typefox.yang/src/test/java/io/typefox/yang/tests/serializer/SerializationTest.xtend index 14beace6..349accd1 100644 --- a/yang-lsp/io.typefox.yang/src/test/java/io/typefox/yang/tests/serializer/SerializationTest.xtend +++ b/yang-lsp/io.typefox.yang/src/test/java/io/typefox/yang/tests/serializer/SerializationTest.xtend @@ -4,7 +4,6 @@ import io.typefox.yang.tests.AbstractYangTest import io.typefox.yang.yang.Contact import io.typefox.yang.yang.Container import io.typefox.yang.yang.Description -import io.typefox.yang.yang.Grouping import io.typefox.yang.yang.KeyReference import io.typefox.yang.yang.Leaf import io.typefox.yang.yang.List @@ -414,7 +413,7 @@ class SerializationTest extends AbstractYangTest { resource.assertNoErrors() val module = resource.contents.head as Module val uses = module.substatements.get(4).substatements.get(2).substatements.get(1) as Uses - assertTrue(uses.grouping.node instanceof Grouping) + assertNotNull(uses.grouping.node) assertFalse((uses.grouping.node as InternalEObject).eIsProxy) val serialized = resource.serializer.serialize(resource.contents.head)