mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 08:48:55 +00:00
[xtext.xtext] delete FQN-Provider and re-enable serializer test
The old XtextQualifiedNameProvider defined "::" as delimiter. However, qualified names (grammar names) in Xtext use "." as delimiter. Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
This commit is contained in:
parent
30b3b0c1e7
commit
86478856de
4 changed files with 13 additions and 61 deletions
|
@ -64,6 +64,14 @@
|
|||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/xtext/XtextRuntimeModule.java" type="org.eclipse.xtext.XtextRuntimeModule">
|
||||
<filter comment="removed xtext.xtext QualifiedNameProvider" id="338792546">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.xtext.XtextRuntimeModule"/>
|
||||
<message_argument value="bindIQualifiedNameConverter()"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/xtext/formatting/impl/MatcherNFAProvider.java" type="org.eclipse.xtext.formatting.impl.MatcherNFAProvider">
|
||||
<filter id="576720909">
|
||||
<message_arguments>
|
||||
|
|
|
@ -13,7 +13,6 @@ import org.eclipse.xtext.formatting.IFormatter;
|
|||
import org.eclipse.xtext.linking.ILinker;
|
||||
import org.eclipse.xtext.linking.ILinkingDiagnosticMessageProvider;
|
||||
import org.eclipse.xtext.linking.ILinkingService;
|
||||
import org.eclipse.xtext.naming.IQualifiedNameConverter;
|
||||
import org.eclipse.xtext.parser.DefaultEcoreElementFactory;
|
||||
import org.eclipse.xtext.parser.antlr.IReferableElementsUnloader;
|
||||
import org.eclipse.xtext.parser.antlr.SyntaxErrorMessageProvider;
|
||||
|
@ -42,7 +41,6 @@ import org.eclipse.xtext.xtext.XtextFragmentProvider;
|
|||
import org.eclipse.xtext.xtext.XtextLinkingDiagnosticMessageProvider;
|
||||
import org.eclipse.xtext.xtext.XtextLinkingService;
|
||||
import org.eclipse.xtext.xtext.XtextLocationInFileProvider;
|
||||
import org.eclipse.xtext.xtext.XtextQualifiedNameConverter;
|
||||
import org.eclipse.xtext.xtext.XtextReferableElementsUnloader;
|
||||
import org.eclipse.xtext.xtext.XtextResourceDescriptionStrategy;
|
||||
import org.eclipse.xtext.xtext.XtextScopeProvider;
|
||||
|
@ -119,10 +117,6 @@ public class XtextRuntimeModule extends AbstractXtextRuntimeModule {
|
|||
return XtextReferableElementsUnloader.class;
|
||||
}
|
||||
|
||||
public Class<? extends IQualifiedNameConverter> bindIQualifiedNameConverter() {
|
||||
return XtextQualifiedNameConverter.class;
|
||||
}
|
||||
|
||||
public Class<? extends IDiagnosticConverter> bindIDiagnosticConverter() {
|
||||
return XtextDiagnosticConverter.class;
|
||||
}
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*******************************************************************************/
|
||||
package org.eclipse.xtext.xtext;
|
||||
|
||||
import org.eclipse.xtext.naming.IQualifiedNameConverter;
|
||||
|
||||
import com.google.inject.Singleton;
|
||||
|
||||
/**
|
||||
* @author Jan Koehnlein - Initial contribution and API
|
||||
*/
|
||||
@Singleton
|
||||
public class XtextQualifiedNameConverter extends IQualifiedNameConverter.DefaultImpl {
|
||||
|
||||
@Override
|
||||
public String getDelimiter() {
|
||||
return "::";
|
||||
}
|
||||
|
||||
}
|
|
@ -16,9 +16,7 @@ import org.eclipse.xtext.junit4.serializer.SerializerTester;
|
|||
import org.eclipse.xtext.resource.XtextResourceSet;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
/**
|
||||
* @author Moritz Eysholdt - Initial contribution and API
|
||||
|
@ -29,16 +27,6 @@ public class XtextSerializerTest extends AbstractXtextTests {
|
|||
|
||||
private Grammar load(URI uri) {
|
||||
XtextResourceSet rs = new XtextResourceSet();
|
||||
// rs.getURIConverter()
|
||||
// .getURIMap()
|
||||
// .put(rs.getURIConverter().normalize(URI.createURI("classpath:/org/eclipse/xtext/Xtext.ecore")),
|
||||
// URI.createURI("http://www.eclipse.org/2008/Xtext"));
|
||||
// URIConverter.URI_MAP.put(URI.createURI("http://www.eclipse.org/2008/Xtext"),
|
||||
// URI.createURI("classpath:/org/eclipse/xtext/Xtext.ecore"));
|
||||
// rs.getURIConverter()
|
||||
// .getURIMap()
|
||||
// .put(rs.getURIConverter().normalize(URI.createURI("classpath:/org/eclipse/xtext/Xtext.xtext")),
|
||||
// URI.createURI("http://www.eclipse.org/2008/Xtext"));
|
||||
return (Grammar) rs.getResource(uri, true).getContents().get(0);
|
||||
}
|
||||
|
||||
|
@ -48,31 +36,18 @@ public class XtextSerializerTest extends AbstractXtextTests {
|
|||
StandaloneSetup standaloneSetup = new StandaloneSetup();
|
||||
standaloneSetup.setIgnoreBrokenProjectFiles(true);
|
||||
standaloneSetup.setPlatformUri("../..");
|
||||
with(new XtextStandaloneSetup() {
|
||||
@Override
|
||||
public Injector createInjector() {
|
||||
return Guice.createInjector(new org.eclipse.xtext.XtextRuntimeModule() {
|
||||
@Override
|
||||
public Class<? extends org.eclipse.xtext.serializer.ISerializer> bindISerializer() {
|
||||
return org.eclipse.xtext.serializer.impl.Serializer.class;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
with(new XtextStandaloneSetup());
|
||||
getInjector().injectMembers(this);
|
||||
}
|
||||
|
||||
@Test public void testDummy() {
|
||||
}
|
||||
|
||||
public void _testXtextXtextWithNM() throws Exception {
|
||||
@Test
|
||||
public void testXtextXtextWithNM() throws Exception {
|
||||
Grammar grammar = load(URI.createURI("classpath:/org/eclipse/xtext/Xtext.xtext"));
|
||||
tester.assertSerializeWithNodeModel(grammar);
|
||||
}
|
||||
|
||||
public void _testXtextXtextWithoutNM() throws Exception {
|
||||
@Test
|
||||
public void testXtextXtextWithoutNM() throws Exception {
|
||||
Grammar grammar = load(URI.createURI("classpath:/org/eclipse/xtext/Xtext.xtext"));
|
||||
tester.assertSerializeWithoutNodeModel(grammar);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue