GithubHelp home page GithubHelp logo

xtext-extras's Introduction

Eclipse Xtext Extras

Notice

The content of this repository (xtext-extras) has been moved to the Xtext Monorepo. Please refer to that repository to find the code, create issues or file pull requests.

About

This repository contains platform-independent add-ons such as Xbase.

How To Build

Check out and run ./gradlew build.

Additional command line arguments:

  • -PcompileXtend=true activates the Xtend compiler, but this is optional because the generated Java code is included in the repository.
  • -PuseJenkinsSnapshots=true switches to using the Maven repositories generated by the Jenkins build jobs for xtext-lib and xtext-core. Without this argument, Sonatype snapshots are used.

Continuous Integration

This project is built by the xtext-extras multi-branch job on Jenkins.

xtext-extras's People

Contributors

akosyakov avatar arnedeutsch avatar asheiduk avatar cdietrich avatar dhuebner avatar gallandarakhneorg avatar holgerschill avatar jankoehnlein avatar joergreichertn4 avatar jrosczak avatar lievenlemiengre avatar lorenzobettini avatar maggu2810 avatar mbarbero avatar merks avatar meysholdt avatar miklossy avatar nbhusare avatar nicoprediger avatar nineninesevenfour avatar oehme avatar sailingkieler avatar spoenemann avatar svenefftinge avatar szarnekow avatar tivervac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xtext-extras's Issues

[XbaseValidator] NPE in checkCasts

I just faced a NPE while editing Xtend code:

Thread [Worker-50] (Suspended (exception NullPointerException)) 
    owns: Object  (id=1091) 
    StandardTypeReferenceOwner.<init>(CommonTypeComputationServices, EObject) line: 42  
    XtendValidator(XbaseValidator).toLightweightTypeReference(JvmTypeReference, boolean) line: 387  
    XtendValidator(XbaseValidator).toLightweightTypeReference(JvmTypeReference) line: 383   
    XtendValidator(XbaseValidator).checkCasts(XCastedExpression) line: 822  
    ...

The context was while editing a cast expression which is not complete yet:

(model.declarations.head as 

In this case context is null. Going back in the stack to XbaseValidator#checkCasts it shows that cast#type is null. This could be guarded.

The issue is low severity since exceptions are catched anyway, but if NPEs are not thrown while debugging this would be nicer.

Xbase serializer tests are broken in master

While working on Xbase issues, I noted that some Xbase serializer tests are broken in master, see

http://services.typefox.io/open-source/jenkins/job/xtext-extras/job/master/lastCompletedBuild/testReport/

The problematic commit, which comes from xtext-core, is this one eclipse/xtext-core@cb9981d which was merged as part of eclipse/xtext-core#129

@meysholdt could you please have a look?

One of the failing test fails due to wrong expectation, but there are also two tests failing with a NPE

[Xbase] Octal Literals: Missing Range Check

The Octal Literals miss a range check at model time

	def static void main(String[] args) {
		println(019)
	}

leads to

Java problem: The literal 019 of type int is out of range

BatchLinkableResourceStorageLoadable/Writable loose order of AssociationsAdapter

a BatchLinkableResource serialized with BatchLinkableResourceStorageWritable and read again with BatchLinkableResourceStorageLoadable (as it is done by BatchLinkableResourceStorageFacade) looses the order of the maps and the set entries inside the map for AssociationsAdapter.

thus using IJvmModelAssociations.getPrimaryJvmElement(EObject) etc. on a loaded resource leads to unpredictable behaviour

[Formatter] Xtext generates a broken link.

Xtext generates a broken link {@link org.eclipse.xtext.xtext.XtextFormattingTokenSerializer} within the Formatter.java class.
formatter_broken_link
xtext-extras/org.eclipse.xtext.generator/src/org/eclipse/xtext/generator/formatting/FormatterFragment.xpt

Remove org.eclipse.xtext.extras.tests/testdata

The path org.eclipse.xtext.extras.tests/testdata contains only the folder wizard-expectations, which contains test projects for the Xtext wizard. This is a duplicate of org.eclipse.xtext.tests/testdata, where the actual place is. The testdata is evaluated by test CliWizardIntegrationTest.xtend.

This means the folder is obsolete in project org.eclipse.xtext.extras.tests.

StackOverflowError when executing CachingReflectionTypeProviderPerformanceTest

StackOverflowError when executing CachingReflectionTypeProviderPerformanceTest

object that is beeing searched is

java:/Objects/java.lang.invoke.LambdaForm#java.lang.invoke.LambdaForm$NamedFunction

ClassMirror(AbstractClassMirror).findMember(EObject, String) line: 125	
ClassMirror(AbstractClassMirror).getEObject(Resource, String, IFragmentProvider$Fallback) line: 108	
TypeResource.getEObject(String) line: 90	
SynchronizedXtextResourceSet(ResourceSetImpl).getEObject(URI, boolean) line: 223	
IndexedJvmTypeAccess.getIndexedJvmType(URI, ResourceSet, boolean) line: 79	
IndexedJvmTypeAccess.getIndexedJvmType(URI, ResourceSet) line: 69	
TypeResource.resolveJavaObjectURIProxy(InternalEObject, EObject) line: 164	
JvmParameterizedTypeReferenceImplCustom(JvmTypeReferenceImplCustom).eResolveProxy(InternalEObject) line: 27	
JvmParameterizedTypeReferenceImplCustom(JvmParameterizedTypeReferenceImpl).getType() line: 111	
JvmConstructorImplCustom(JvmExecutableImplCustom).computeIdentifier() line: 43	
JvmConstructorImplCustom(JvmMemberImplCustom).getIdentifier() line: 22	
ClassMirror(AbstractClassMirror).findMember(EObject, String) line: 125	
ClassMirror(AbstractClassMirror).findMember(EObject, String) line: 130	
ClassMirror(AbstractClassMirror).getEObject(Resource, String, IFragmentProvider$Fallback) line: 108	
TypeResource.getEObject(String) line: 90	
SynchronizedXtextResourceSet(ResourceSetImpl).getEObject(URI, boolean) line: 223	
IndexedJvmTypeAccess.getIndexedJvmType(URI, ResourceSet, boolean) line: 79	
IndexedJvmTypeAccess.getIndexedJvmType(URI, ResourceSet) line: 69	
TypeResource.resolveJavaObjectURIProxy(InternalEObject, EObject) line: 164	
JvmParameterizedTypeReferenceImplCustom(JvmTypeReferenceImplCustom).eResolveProxy(InternalEObject) line: 27	
JvmParameterizedTypeReferenceImplCustom(JvmParameterizedTypeReferenceImpl).getType() line: 111	
JvmConstructorImplCustom(JvmExecutableImplCustom).computeIdentifier() line: 43	
JvmConstructorImplCustom(JvmMemberImplCustom).getIdentifier() line: 22	
ClassMirror(AbstractClassMirror).findMember(EObject, String) line: 125	
ClassMirror(AbstractClassMirror).findMember(EObject, String) line: 130	
ClassMirror(AbstractClassMirror).getEObject(Resource, String, IFragmentProvider$Fallback) line: 108	
TypeResource.getEObject(String) line: 90	
SynchronizedXtextResourceSet(ResourceSetImpl).getEObject(URI, boolean) line: 223	
IndexedJvmTypeAccess.getIndexedJvmType(URI, ResourceSet, boolean) line: 79	
IndexedJvmTypeAccess.getIndexedJvmType(URI, ResourceSet) line: 69	
TypeResource.resolveJavaObjectURIProxy(InternalEObject, EObject) line: 164	
JvmParameterizedTypeReferenceImplCustom(JvmTypeReferenceImplCustom).eResolveProxy(InternalEObject) line: 27	
JvmParameterizedTypeReferenceImplCustom(JvmParameterizedTypeReferenceImpl).getType() line: 111	
JvmConstructorImplCustom(JvmExecutableImplCustom).computeIdentifier() line: 43	
JvmConstructorImplCustom(JvmMemberImplCustom).getIdentifier() line: 22	
ClassMirror(AbstractClassMirror).findMember(EObject, String) line: 125	
ClassMirror(AbstractClassMirror).findMember(EObject, String) line: 130	
ClassMirror(AbstractClassMirror).getEObject(Resource, String, IFragmentProvider$Fallback) line: 108	
TypeResource.getEObject(String) line: 90	
SynchronizedXtextResourceSet(ResourceSetImpl).getEObject(URI, boolean) line: 223	
IndexedJvmTypeAccess.getIndexedJvmType(URI, ResourceSet, boolean) line: 79	
IndexedJvmTypeAccess.getIndexedJvmType(URI, ResourceSet) line: 69	
TypeResource.resolveJavaObjectURIProxy(InternalEObject, EObject) line: 164	
JvmParameterizedTypeReferenceImplCustom(JvmTypeReferenceImplCustom).eResolveProxy(InternalEObject) line: 27	
JvmParameterizedTypeReferenceImplCustom(JvmParameterizedTypeReferenceImpl).getType() line: 111	
JvmConstructorImplCustom(JvmExecutableImplCustom).computeIdentifier() line: 43	
JvmConstructorImplCustom(JvmMemberImplCustom).getIdentifier() line: 22	
ClassMirror(AbstractClassMirror).findMember(EObject, String) line: 125	
ClassMirror(AbstractClassMirror).findMember(EObject, String) line: 130	
ClassMirror(AbstractClassMirror).getEObject(Resource, String, IFragmentProvider$Fallback) line: 108	
TypeResource.getEObject(String) line: 90	
SynchronizedXtextResourceSet(ResourceSetImpl).getEObject(URI, boolean) line: 223	
IndexedJvmTypeAccess.getIndexedJvmType(URI, ResourceSet, boolean) line: 79	
IndexedJvmTypeAccess.getIndexedJvmType(URI, ResourceSet) line: 69	
TypeResource.resolveJavaObjectURIProxy(InternalEObject, EObject) line: 164	
JvmParameterizedTypeReferenceImplCustom(JvmTypeReferenceImplCustom).eResolveProxy(InternalEObject) line: 27	
JvmParameterizedTypeReferenceImplCustom(JvmParameterizedTypeReferenceImpl).getType() line: 111	
JvmConstructorImplCustom(JvmExecutableImplCustom).computeIdentifier() line: 43	
JvmConstructorImplCustom(JvmMemberImplCustom).getIdentifier() line: 22	
ClassMirror(AbstractClassMirror).findMember(EObject, String) line: 125	
ClassMirror(AbstractClassMirror).findMember(EObject, String) line: 130	
ClassMirror(AbstractClassMirror).getEObject(Resource, String, IFragmentProvider$Fallback) line: 108	
TypeResource.getEObject(String) line: 90	
SynchronizedXtextResourceSet(ResourceSetImpl).getEObject(URI, boolean) line: 223	
IndexedJvmTypeAccess.getIndexedJvmType(URI, ResourceSet, boolean) line: 79	
IndexedJvmTypeAccess.getIndexedJvmType(URI, ResourceSet) line: 69	
TypeResource.resolveJavaObjectURIProxy(InternalEObject, EObject) line: 164	
JvmParameterizedTypeReferenceImplCustom(JvmTypeReferenceImplCustom).eResolveProxy(InternalEObject) line: 27	
JvmParameterizedTypeReferenceImplCustom(JvmParameterizedTypeReferenceImpl).getType() line: 111	
JvmParameterizedTypeReferenceImplCustom(JvmParameterizedTypeReferenceImpl).eGet(int, boolean, boolean) line: 173	
JvmParameterizedTypeReferenceImplCustom(BasicEObjectImpl).eGet(EStructuralFeature, boolean, boolean) line: 1011	
JvmParameterizedTypeReferenceImplCustom(BasicEObjectImpl).eGet(EStructuralFeature, boolean) line: 1003	
ECrossReferenceEList$ResolvingFeatureIteratorImpl<E>(EContentsEList$FeatureIteratorImpl<E>).hasNext() line: 439	
EcoreUtil.resolveCrossReferences(EObject) line: 304	
EcoreUtil.resolveAll(EObject) line: 298	
EcoreUtil.resolveAll(Resource) line: 283	
EcoreUtil.resolveAll(ResourceSet) line: 271	
CachingReflectionTypeProviderPerformanceTest(AbstractTypeProviderPerformanceTest).loadAndResolve(String, boolean, boolean, boolean, boolean, boolean) line: 106	
CachingReflectionTypeProviderPerformanceTest.loadAndResolve(String, boolean, boolean, boolean, boolean, boolean) line: 56	
CachingReflectionTypeProviderPerformanceTest(AbstractTypeProviderPerformanceTest).testLoadTypesAndResolveAllParameterNames() line: 78	
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 62	
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43	
Method.invoke(Object, Object...) line: 498	
FrameworkMethod$1.runReflectiveCall() line: 50	
FrameworkMethod$1(ReflectiveCallable).run() line: 12	
FrameworkMethod.invokeExplosively(Object, Object...) line: 47	
InvokeMethod.evaluate() line: 17	
RunBefores.evaluate() line: 26	
RunAfters.evaluate() line: 27	
StopwatchRule$1.evaluate() line: 116	
RunRules.evaluate() line: 20	
XtextRunner$1.evaluate() line: 49	
XtextRunner(ParentRunner<T>).runLeaf(Statement, Description, RunNotifier) line: 325	
XtextRunner(BlockJUnit4ClassRunner).runChild(FrameworkMethod, RunNotifier) line: 78	
XtextRunner(BlockJUnit4ClassRunner).runChild(Object, RunNotifier) line: 57	
ParentRunner$3.run() line: 290	
ParentRunner$1.schedule(Runnable) line: 71	
XtextRunner(ParentRunner<T>).runChildren(RunNotifier) line: 288	
ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 58	
ParentRunner$2.evaluate() line: 268	
XtextRunner(ParentRunner<T>).run(RunNotifier) line: 363	
JUnit4TestReference.run(TestExecution) line: 86	
TestExecution.run(ITestReference[]) line: 38	
RemoteTestRunner.runTests(String[], String, TestExecution) line: 459	
RemoteTestRunner.runTests(TestExecution) line: 675	
RemoteTestRunner.run() line: 382	
RemoteTestRunner.main(String[]) line: 192	

[compiler] Treat "object != null" like "object !== null"

The code produced for object !== null is slightly more efficient than object != null. Users are not aware of the fact and will usually use the != operator, since they are just used to it. Xbase produced (!Objects.equal(_object, null)) from it, while using the !== operator would compare the objects directly.

The compiler should produce the same output and avoid the call of Objects.equal when one operator is the null literal.

Cleanup Gradle File

Somebody with gradle knowledge needs to cleanup/unify the gradle files i created for test cleanup

Verify changes to test

Make sure my fix for

AbstractXbaseLinkingTest
ResolvedOperationTest
testdata.MethodOverrides4.staticM5(T)
testdata.MethodOverrides3.staticM5(T)

regarding orverrding parameterless static methods no longer beeing possible in Java 7+
is correct

[xbase] Getter/setter body uncompilable when field name is a keyword

To reproduce the issue use the Domainmodel example and add to the grammar:

ValidID:
    ID | KEYWORD
;

KEYWORD: 'package' | 'entity';

This will allow to use package and entity as valid identifiers for e.g. property names. The following DSL sample would be valid:

package test {
    entity Delivery {
        weight  : int
        package : boolean
    }
}

However, it will produce invalid Java code:

screenshot 1

While the field name is suffixed with _ to package_, the getter/setter bodies do not make use of this escaping, leading to compile errors.

Missing about.html in purexbase.ide

Check files and layout in bundles and features.

Checking: /home/hudson/genie.xtext/.hudson/jobs/simrel-tests/workspace/build-result/p2.repository/features
 Checked 11 of 11.
 Errors found: 0

 Checking: /home/hudson/genie.xtext/.hudson/jobs/simrel-tests/workspace/build-result/p2.repository/plugins
 Checked 107 of 107.
 Errors found: 2
Missing (?:about|about_org.eclipse.xtext.purexbase.ide).html in file: org.eclipse.xtext.purexbase.ide.source_2.12.0.v20170223-0942.jar
Missing (?:about|about_org.eclipse.xtext.purexbase.ide).html in file: org.eclipse.xtext.purexbase.ide_2.12.0.v20170223-0942.jar

[ASM] IncrementalBuilder with JavaLanguage does not work with Inner Classes

Having a Java Class like

package mypack;
public class FakeIssue60GrammarAccess {

    private final GreetingElements pGreeting;

    public FakeIssue60GrammarAccess() {
        this.pGreeting = new GreetingElements();
    }

    public class GreetingElements {

        public String getHelloKeyword_0() { return null; }

    }

    public GreetingElements getGreetingAccess() {
        return pGreeting;
    }

}   

and a Xtend class like

package mypack

import mypack.FakeIssue60GrammarAccess$GreetingElements

class Demo {

    extension mypack.FakeIssue60GrammarAccess

    GreetingElements elements

    def void format() {
        greetingAccess.helloKeyword_0
        println(elements)
    }

}

then the compilation with the incremental builder e.g. xtend-gradle-plugin fails with ERROR:The method getGreetingAccess() from the type FakeIssue60GrammarAccess refers to the missing type Object

see xtext/xtext-gradle-plugin#60

Make setting Java version in compiler tests easier

I'm about to contribute a PR for making setting the Java version easier when using CompilationTestHelper and OnTheFlyJavaCompiler2. This will set both the Java version for the DSL compiler (e.g., Xbase) and for the Java compiler.

NullPointer while trying to extract method

Using Xtext Complete SDK 2.10.0v201605250459 in Eclipse 4.6.2

java.lang.NullPointerException
	at org.eclipse.xtext.xbase.compiler.AbstractStringBuilderBasedAppendable.append(AbstractStringBuilderBasedAppendable.java:60)
	at org.eclipse.xtext.xbase.compiler.AbstractStringBuilderBasedAppendable.append(AbstractStringBuilderBasedAppendable.java:1)
	at org.eclipse.xtend.ide.refactoring.ExtractMethodRefactoring.appendMethodSignature(ExtractMethodRefactoring.java:307)
	at org.eclipse.xtend.ide.refactoring.ExtractMethodRefactoring.getMethodSignature(ExtractMethodRefactoring.java:279)
	at org.eclipse.xtend.ide.refactoring.ExtractMethodUserInputPage.createSignaturePreview(ExtractMethodUserInputPage.java:208)
	at org.eclipse.xtend.ide.refactoring.ExtractMethodUserInputPage.createControl(ExtractMethodUserInputPage.java:91)
	at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.createContents(RefactoringWizardDialog2.java:625)
	at org.eclipse.jface.window.Window.create(Window.java:426)
	at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1095)
	at org.eclipse.xtext.ui.refactoring.ui.RefactoringWizardOpenOperation_NonForking$1.run(RefactoringWizardOpenOperation_NonForking.java:103)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.xtext.ui.refactoring.ui.RefactoringWizardOpenOperation_NonForking.run(RefactoringWizardOpenOperation_NonForking.java:126)
	at org.eclipse.xtext.ui.refactoring.ui.RefactoringWizardOpenOperation_NonForking.run(RefactoringWizardOpenOperation_NonForking.java:71)
	at org.eclipse.xtend.ide.refactoring.ExtractMethodHandler.execute(ExtractMethodHandler.java:81)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:295)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
	at sun.reflect.GeneratedMethodAccessor290.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:282)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:264)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:494)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:488)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:286)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:507)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:558)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:378)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$0(KeyBindingDispatcher.java:324)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:86)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1605)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1339)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1366)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1349)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1378)
	at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:764)
	at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:3465)
	at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:801)
	at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2000)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:5827)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5498)
	at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
	at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:9545)
	at org.eclipse.swt.widgets.Display.eventProc(Display.java:1275)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2495)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4149)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1488)

[Xbase] BigInteger Literals are broken at runtime

1.23e123bi compiles tonew BigInteger("1.23").multiply(BigInteger.TEN.pow(123))
which leads to following exception at runtime

Exception in thread "main" java.lang.NumberFormatException: For input string: "1.23"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:580)
    at java.math.BigInteger.<init>(BigInteger.java:461)
    at java.math.BigInteger.<init>(BigInteger.java:597)

Build does not work without -PuseJenkinsSnapshots=true

* What went wrong:
Could not resolve all dependencies for configuration ':org.eclipse.xtext.common.types.tests:testCompileClasspath'.
> Could not find org.eclipse.xtext:org.eclipse.xtext.testlanguages:2.12.0-SNAPSHOT.
  Searched in the following locations:
      https://jcenter.bintray.com/org/eclipse/xtext/org.eclipse.xtext.testlanguages/2.12.0-SNAPSHOT/maven-metadata.xml
      https://jcenter.bintray.com/org/eclipse/xtext/org.eclipse.xtext.testlanguages/2.12.0-SNAPSHOT/org.eclipse.xtext.testlanguages-2.12.0-SNAPSHOT.pom
      https://jcenter.bintray.com/org/eclipse/xtext/org.eclipse.xtext.testlanguages/2.12.0-SNAPSHOT/org.eclipse.xtext.testlanguages-2.12.0-SNAPSHOT.jar
      file:/home/dietrich/.m2/repository/org/eclipse/xtext/org.eclipse.xtext.testlanguages/2.12.0-SNAPSHOT/maven-metadata.xml
      file:/home/dietrich/.m2/repository/org/eclipse/xtext/org.eclipse.xtext.testlanguages/2.12.0-SNAPSHOT/org.eclipse.xtext.testlanguages-2.12.0-SNAPSHOT.pom
      file:/home/dietrich/.m2/repository/org/eclipse/xtext/org.eclipse.xtext.testlanguages/2.12.0-SNAPSHOT/org.eclipse.xtext.testlanguages-2.12.0-SNAPSHOT.jar
      https://oss.sonatype.org/content/repositories/snapshots/org/eclipse/xtext/org.eclipse.xtext.testlanguages/2.12.0-SNAPSHOT/maven-metadata.xml
      https://oss.sonatype.org/content/repositories/snapshots/org/eclipse/xtext/org.eclipse.xtext.testlanguages/2.12.0-SNAPSHOT/org.eclipse.xtext.testlanguages-2.12.0-SNAPSHOT.pom
      https://oss.sonatype.org/content/repositories/snapshots/org/eclipse/xtext/org.eclipse.xtext.testlanguages/2.12.0-SNAPSHOT/org.eclipse.xtext.testlanguages-2.12.0-SNAPSHOT.jar
  Required by:
      project :org.eclipse.xtext.common.types.tests

* Try:

@meysholdt @dhuebner @spoenemann are testlangs not published to oss?

[refactoring] Migrate Xbase Testlanguages to new generator

The workflow GenerateXbaseTestLanguages.mwe2 uses the old generator infrastructure and should be refactored to the new generator.

This will affect the produced sources in org.eclipse.xtext.xbase.testlanguages and org.eclipse.xtext.xbase.testlanguages.ui. Usually this would also imply new projects

  • org.eclipse.xtext.xbase.testlanguages.ide
  • org.eclipse.xtext.xbase.testlanguages.tests
  • org.eclipse.xtext.xbase.testlanguages.ui.tests
    but for simplicity the generated sources could also be put into the both existing projects.

The UI project org.eclipse.xtext.xbase.testlanguages.ui is contained in the repository xtext-eclipse, thus the generator has to produce code to the other repo location. It should be assumed that it resides in "xtext-eclipse.git" as it would be checked out by Oomph.

name may not be null xtext 2.12

2.12 and throws below exception when doing content assist. HDslParsingTest under henkan dsl project can compile successfully. I see this exception when i run my project with RunWebSocketServer and use vscode. Project and associated forum topic is below

https://www.eclipse.org/forums/index.php/t/1086556/
henkan.dsl.parent.tar.gz

Caused by: java.lang.UnsupportedOperationException: The resource 'file:///home/capacman/programlama/xtext-workspace/henkan.dsl.parent/vscode-hdsl-ext/exampleproject/example.hl' has been loaded without tracking the feature scope. Please check the implementation of IFeatureScopeTracker.Provider.
at org.eclipse.xtext.xbase.typesystem.internal.IFeatureScopeTracker$1.getExpressionScope(IFeatureScopeTracker.java:63)
at org.eclipse.xtext.xbase.typesystem.internal.ResolvedTypes.getExpressionScope(ResolvedTypes.java:1507)
at org.eclipse.xtext.xbase.typesystem.internal.CompoundReentrantTypeResolver.getExpressionScope(CompoundReentrantTypeResolver.java:180)
at org.eclipse.xtext.xbase.typesystem.internal.ForwardingResolvedTypes.getExpressionScope(ForwardingResolvedTypes.java:134)
at org.eclipse.xtext.xbase.ide.contentassist.XbaseIdeContentProposalProvider.createReceiverProposals(XbaseIdeContentProposalProvider.java:606)
at org.eclipse.xtext.xbase.ide.contentassist.XbaseIdeContentProposalProvider.completeBinaryOperation(XbaseIdeContentProposalProvider.java:535)
at org.eclipse.xtext.xbase.ide.contentassist.XbaseIdeContentProposalProvider._createProposals(XbaseIdeContentProposalProvider.java:377)
at org.eclipse.xtext.xbase.ide.contentassist.XbaseIdeContentProposalProvider.createProposals(XbaseIdeContentProposalProvider.java:641)
at org.eclipse.xtext.ide.editor.contentassist.IdeContentProposalProvider.createProposals(IdeContentProposalProvider.java:94)
at org.eclipse.xtext.ide.server.contentassist.ContentAssistService.createProposals(ContentAssistService.java:108)
at org.eclipse.xtext.ide.server.contentassist.ContentAssistService.createCompletionList(ContentAssistService.java:73)
at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$completion$14(LanguageServerImpl.java:425)
at org.eclipse.xtext.ide.server.WorkspaceManager.doRead(WorkspaceManager.java:234)
at org.eclipse.xtext.ide.server.LanguageServerImpl.completion(LanguageServerImpl.java:427)
at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$completion$13(LanguageServerImpl.java:406)
at org.eclipse.xtext.ide.server.concurrent.RequestManager.lambda$runRead$2(RequestManager.java:116)
at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
... 5 more

Make extras tests work

There are several test projects that are currently disabled: xbase.tests, java.tests, etc. Those tests that cannot be run in a standalone environment should be moved to xtext-eclipse.

content assist blocked after expression with nested lambdas

To reproduce, create a simple class
Test.xtend:

class Test{
	def test(Object p1, Object p2){
	}
	def whenOK((Object)=>void p) {		
	}
}

then create a test.xbase file with the content:

val t = new Test()
t.test(t, t.whenOK[
t.test(t, t.whenOK[
t.test(t, t.whenOK[
t.test(t, t.whenOK[
t.test(t, t.whenOK[
t.test(t, t.whenOK[
t.test(t, t.whenOK[
t.test(t, t.whenOK[
t.test(t, t.whenOK[
	
])
])
])
])
])
])
])
])
])

press Ctrl + Space to trigger content assist. Then the editor gets stuck.

The editor only takes about 10 seconds to responde when the code is changed to :

val t = new Test()
t.test(t, [
t.test(t, [
t.test(t, [
t.test(t, [
t.test(t, [
t.test(t, [
t.test(t, [
t.test(t, [
t.test(t, [	
])
])
])
])
])
])
])
])
])

So it maybe depends on how deep the lambda is nested.

The problem seems to be in the parser when content assist builds the context.
see also: https://www.eclipse.org/forums/index.php/t/1086575/

Generated code optimization

In my DSL, I have:

import io.sarl.C1
agent A {
   def caller {
     getSkill(C1).myfunction(Integer)
     getSkill(C1).myfunction(Float, 1)
     getSkill(C1).myfunction(String, 2, 3)
   }
}

The generated Java code is:

import io.sarl.C1;
public class A extends Agent {
  protected void caller() {
    C1 _skill = this.getSkill(C1.class);
    _skill.myfunction(Integer.class);
    C1 _skill_1 = this.getSkill(C1.class);
    _skill_1.myfunction(Float.class, 1);
    C1 _skill_2 = this.getSkill(C1.class);
    _skill_2.myfunction(String.class, 2, 3);
  }
}

In the generated code, the three variables _skill, _skill_1, _skill_2 are pointing to the same C1 instance; because there is no setSkill call.

Note that getSkill is anotated with @Pure.

It would be nice if the Xbase expression compiler is able to optmize the generated code in order to obtain:

import io.sarl.C1;
public class A extends Agent {
  protected void caller() {
    C1 _skill = this.getSkill(C1.class);
    _skill.myfunction(Integer.class);
    _skill.myfunction(Float.class, 1);
    _skill.myfunction(String.class, 2, 3);
  }
}
[/code]

Of course, the DSL user may type the following code for obtaining an optimized input code, such as:

import io.sarl.C1
agent A {
def caller {
val s = getSkill(C1)
s.myfunction(Integer)
s.myfunction(Float, 1)
s.myfunction(String, 2, 3)
}
}

But it depends on the DSL user skills. It would be better if the Xbase expression compiler is able to do some optimization tasks itself.

Broken Organization Name in pom.xmls

see https://repo.maven.apache.org/maven2/org/eclipse/xtext/org.eclipse.xtext.common.types/2.11.0.RC2/org.eclipse.xtext.common.types-2.11.0.RC2.pom

Actual:

<developer>
<name>Sven Efftinge</name>
<email>[email protected]</email>
<organization>org.apache.maven.model.Organization@29172711</organization>
<organizationUrl>http://typefox.io</organizationUrl>
</developer>

Expected:

<organization>TypeFox GmbH</organization>

The issue also occurs for committers from other organizations.

Feature call of constant inline expressions

Let a not-static function with an inline constant expression:

class C1 {
    @Inline(value = "1", constantExpression = true)
    def int getValue() {
        return 1
    }
}
class C2 {
   def test {
       var c = new C1
       System.out.println(c.value)
   }
}

The generated Java code for the test function is:

public void test() {
    C1 c = new C1();
    System.out.println(c.1);
}

The Java code has a syntax error because 1 is not a valid member of C1.

Fix JavaResource

The Changes to Java Resource in 11386fc

make tests in xtext-xtend fail (e.g. XtendIncrementalBuilderTest)
and make the build of xtext-extras itself fail

Caused by: java.lang.NullPointerException
        at org.eclipse.xtext.common.types.access.impl.AbstractClassMirror.getEObject(AbstractClassMirror.java:69)
        at org.eclipse.xtext.common.types.access.TypeResource.getEObject(TypeResource.java:90)
        at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:223)
        at org.eclipse.xtext.common.types.access.impl.IndexedJvmTypeAccess.getIndexedJvmType(IndexedJvmTypeAccess.java:79)
        at org.eclipse.xtext.common.types.access.impl.IndexedJvmTypeAccess.getIndexedJvmType(IndexedJvmTypeAccess.java:69)
        at org.eclipse.xtext.java.resource.JavaResource.resolveJavaObjectURIProxy(JavaResource.java:189)
        at org.eclipse.xtext.common.types.impl.JvmAnnotationValueImplCustom.eResolveProxy(JvmAnnotationValueImplCustom.java:22)
        at org.eclipse.xtext.common.types.impl.JvmAnnotationValueImpl.getOperation(JvmAnnotationValueImpl.java:78)
        at org.eclipse.xtext.common.types.impl.JvmAnnotationValueImpl.eGet(JvmAnnotationValueImpl.java:134)
        at org.eclipse.xtext.common.types.impl.JvmBooleanAnnotationValueImpl.eGet(JvmBooleanAnnotationValueImpl.java:94)
        at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1011)
        at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1003)
        at org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImpl.hasNext(EContentsEList.java:439)
        at org.eclipse.xtext.EcoreUtil2.resolveCrossReferences(EcoreUtil2.java:518)
        at org.eclipse.xtext.EcoreUtil2.resolveAll(EcoreUtil2.java:487)
        at org.eclipse.xtext.EcoreUtil2.resolveLazyCrossReferences(EcoreUtil2.java:500)
        at org.eclipse.xtext.build.IncrementalBuilder$InternalStatefulIncrementalBuilder.lambda$launch$6(IncrementalBuilder.java:224)
        at org.eclipse.xtext.build.ClusteringStorageAwareResourceLoader.lambda$executeClustered$1(ClusteringStorageAwareResourceLoader.java:86)
        at org.eclipse.xtext.xbase.lib.internal.FunctionDelegate.apply(FunctionDelegate.java:42)
        at com.google.common.collect.Lists$TransformingRandomAccessList$1.transform(Lists.java:617)
        at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
        at com.google.common.collect.Iterables.addAll(Iterables.java:352)
        at org.eclipse.xtext.build.ClusteringStorageAwareResourceLoader.executeClustered(ClusteringStorageAwareResourceLoader.java:89)
        at org.eclipse.xtext.build.BuildContext.executeClustered(BuildContext.java:56)
        at org.eclipse.xtext.build.IncrementalBuilder$InternalStatefulIncrementalBuilder.launch(IncrementalBuilder.java:248)
        at org.eclipse.xtext.build.IncrementalBuilder.build(IncrementalBuilder.java:419)
        at org.eclipse.xtext.build.IncrementalBuilder.build(IncrementalBuilder.java:400)
        at org.xtext.gradle.builder.XtextGradleBuilder.doBuild(XtextGradleBuilder.java:360)
        at org.xtext.gradle.builder.XtextGradleBuilder.build(XtextGradleBuilder.java:206)
        at org.xtext.gradle.tasks.XtextGenerate.generate(XtextGenerate.java:149)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:163)

org.eclipse.xtext.xbase.tests.URIsInEcoreFilesTest fails in Eclipse

@cdietrich I see that you modified org.eclipse.xtext.xbase.tests.AbstractPortableURIsTest in Commit 9210184 but the test org.eclipse.xtext.xbase.tests.URIsInEcoreFilesTest fails in Eclipse with the following exception.

Can it be due to the fact that it creates platform URIs and this requires a running Eclipse? In that case it should be a UI test, right?

org.eclipse.xtext.resource.ClasspathUriResolutionException: org.eclipse.xtext.resource.FileNotFoundOnClasspathException: Couldn't find resource on classpath. URI was 'classpath:/model/Xbase.ecore'
    at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.resolve(ClassloaderClasspathUriResolver.java:49)
    at org.eclipse.xtext.resource.XtextResourceSet.resolveClasspathURI(XtextResourceSet.java:221)
    at org.eclipse.xtext.resource.XtextResourceSet.access$0(XtextResourceSet.java:220)
    at org.eclipse.xtext.resource.XtextResourceSet$1.normalize(XtextResourceSet.java:284)
    at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.normalize(ExtensibleURIConverterImpl.java:449)
    at org.eclipse.xtext.resource.XtextResourceSet$1.normalize(XtextResourceSet.java:290)
    at org.eclipse.xtext.resource.XtextResourceSet.getResource(XtextResourceSet.java:239)
    at org.eclipse.xtext.xbase.tests.AbstractPortableURIsTest.doTestResource(AbstractPortableURIsTest.java:89)
    at org.eclipse.xtext.xbase.tests.URIsInEcoreFilesTest.testXbase(URIsInEcoreFilesTest.java:18)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: org.eclipse.xtext.resource.FileNotFoundOnClasspathException: Couldn't find resource on classpath. URI was 'classpath:/model/Xbase.ecore'
    at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.findResourceOnClasspath(ClassloaderClasspathUriResolver.java:61)
    at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.resolve(ClassloaderClasspathUriResolver.java:46)
    ... 33 more

Xtend bootstrapping

We need to decide on a good strategy for when to apply the Xtend compiler. In the past we used to just check in the source code and told everyone to use the latest nightly for development. However we need to integrate the xtend compiler in the build to have proper source mapping in the resulting artifacts.

Automatically using the nightly will cause us trouble when someone breaks the xtend compiler accidentally. OTOH we want to use the latest state of the compiler and also want to have sensible turnaround times when fixing something in the compiler.

To the gradle build/experts would it be feasible to have a dedicated build job, where we use the latest successful build result as the bootstrap repository? That job should be parameterizable with a commit hash, so we can set it back in case something broke.

Additionally it would make sense to have one option in the build, that skips the xtend compiler all-together. At least as long as we keep checking in the generate source code this would be an easy way to bypass a broken compiler.

xbase expression performance issue with nested feature calls

It seems that when an xbase expression is deeply nested with feature calls, the performance is poor.
The following xbase expression in op will always block the IDE:

//file: test.dmodel

package t{
    entity M{
        op t(){
            (1..10).forEach[
            (1..10).forEach[
            (1..10).forEach[
            (1..10).forEach[
            (1..10).forEach[
            (1..10).forEach[
            (1..10).forEach[
            (1..10).forEach[
            (1..10).forEach[
            (1..10).forEach[
            ]]]]]]]]]]	

        }
    }
}

This can be reproduced using the example dmodel project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.