Skip to content

Commit

Permalink
Upgrade to Xtext 2.17
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Apr 5, 2019
1 parent 96b9fe6 commit f734300
Show file tree
Hide file tree
Showing 100 changed files with 938 additions and 541 deletions.
Expand Up @@ -225,13 +225,13 @@
<import plugin="io.sarl.lang.core" version="0.9.0" match="greaterOrEqual"/>
<import plugin="io.sarl.eclipse" version="0.9.0" match="greaterOrEqual"/>
<import plugin="io.sarl.lang.ui" version="0.9.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.ui" version="2.15.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.osgi" version="3.13.100" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.commands" version="3.9.200" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.runtime" version="3.15.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jface" version="3.14.100" match="greaterOrEqual"/>
<import plugin="org.eclipse.ui" version="3.110.0" match="greaterOrEqual"/>
<import plugin="com.google.inject" version="4.1.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.ui" version="2.17.0" match="greaterOrEqual"/>
</requires>

<plugin
Expand Down
Expand Up @@ -12,7 +12,7 @@ Export-Package: io.sarl.experienceindex,
Require-Bundle: io.sarl.lang.core;bundle-version="0.9.0",
io.sarl.eclipse;bundle-version="0.9.0",
io.sarl.lang.ui;bundle-version="0.9.0",
org.eclipse.xtext.ui;bundle-version="2.15.0",
org.eclipse.xtext.ui;bundle-version="2.17.0",
org.eclipse.osgi;bundle-version="3.13.100",
org.eclipse.core.commands;bundle-version="3.9.200",
org.eclipse.core.runtime;bundle-version="3.15.0",
Expand Down
Expand Up @@ -223,16 +223,16 @@

<requires>
<import plugin="io.sarl.lang" version="0.9.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.common.types" version="2.15.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.xbase" version="2.15.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext" version="2.15.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtend.core" version="2.15.0" match="greaterOrEqual"/>
<import plugin="io.sarl.lang.ui" version="0.9.0" match="greaterOrEqual"/>
<import plugin="io.sarl.pythongenerator.generator" version="0.9.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.ui" version="2.15.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.runtime" version="3.15.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.resources" version="3.13.100" match="greaterOrEqual"/>
<import plugin="io.sarl.lang.ui" version="0.9.0" match="greaterOrEqual"/>
<import plugin="io.sarl.pythongenerator.generator" version="0.9.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.ui" version="3.110.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.common.types" version="2.17.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.xbase" version="2.17.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext" version="2.17.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtend.core" version="2.17.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.ui" version="2.17.0" match="greaterOrEqual"/>
</requires>

<plugin
Expand Down
Expand Up @@ -13,9 +13,9 @@ Export-Package: io.sarl.pythongenerator.generator,
io.sarl.pythongenerator.generator.validator
Bundle-Activator: io.sarl.pythongenerator.generator.PyGeneratorPlugin
Require-Bundle: io.sarl.lang;bundle-version="0.9.0",
org.eclipse.xtext.common.types;bundle-version="2.15.0",
org.eclipse.xtext.xbase;bundle-version="2.15.0",
org.eclipse.xtext;bundle-version="2.15.0",
org.eclipse.xtend.core;bundle-version="2.15.0",
org.eclipse.xtext.common.types;bundle-version="2.17.0",
org.eclipse.xtext.xbase;bundle-version="2.17.0",
org.eclipse.xtext;bundle-version="2.17.0",
org.eclipse.xtend.core;bundle-version="2.17.0",
org.eclipse.core.runtime;bundle-version="3.15.0",
org.eclipse.core.resources;bundle-version="3.13.100"
Expand Up @@ -14,6 +14,6 @@ Bundle-Activator: io.sarl.pythongenerator.ui.PyGeneratorUiPlugin
Require-Bundle: io.sarl.lang;bundle-version="0.9.0",
io.sarl.lang.ui;bundle-version="0.9.0",
io.sarl.pythongenerator.generator;bundle-version="0.9.0",
org.eclipse.xtext.ui;bundle-version="2.15.0",
org.eclipse.xtext.ui;bundle-version="2.17.0",
org.eclipse.ui;bundle-version="3.110.0",
org.eclipse.core.runtime;bundle-version="3.15.0"
2 changes: 1 addition & 1 deletion formatting-styles/latex/sarl-beamer-listing.sty
Expand Up @@ -22,7 +22,7 @@
% limitations under the License.
%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{sarl-beamer-listing}[2019/01/09]
\ProvidesPackage{sarl-beamer-listing}[2019/04/04]
\newif\ifusesarlcolors\usesarlcolorstrue
\DeclareOption{sarlcolors}{\global\usesarlcolorstrue}
\DeclareOption{nosarlcolors}{\global\usesarlcolorsfalse}
Expand Down
2 changes: 1 addition & 1 deletion formatting-styles/latex/sarl-colorized-listing.sty
Expand Up @@ -22,7 +22,7 @@
% limitations under the License.
%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{sarl-colorized-listing}[2019/01/09]
\ProvidesPackage{sarl-colorized-listing}[2019/04/04]
\newif\ifusesarlcolors\usesarlcolorstrue
\DeclareOption{sarlcolors}{\global\usesarlcolorstrue}
\DeclareOption{nosarlcolors}{\global\usesarlcolorsfalse}
Expand Down
2 changes: 1 addition & 1 deletion formatting-styles/latex/sarl-listing.sty
Expand Up @@ -22,7 +22,7 @@
% limitations under the License.
%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{sarl-listing}[2019/01/09]
\ProvidesPackage{sarl-listing}[2019/04/04]
\newif\ifusesarlcolors\usesarlcolorstrue
\DeclareOption{sarlcolors}{\global\usesarlcolorstrue}
\DeclareOption{nosarlcolors}{\global\usesarlcolorsfalse}
Expand Down
12 changes: 5 additions & 7 deletions main/coreplugins/io.sarl.eclipse/META-INF/MANIFEST.MF
Expand Up @@ -8,10 +8,10 @@ Automatic-Module-Name: io.sarl.eclipse
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Require-Bundle: io.sarl.lang.ui;bundle-version="0.9.0";visibility:=reexport,
org.eclipse.xtend.core;bundle-version="2.15.0",
org.eclipse.xtext.ui;bundle-version="2.15.0",
org.eclipse.xtext.xbase.ui;bundle-version="2.15.0",
org.eclipse.xtext.common.types.ui;bundle-version="2.15.0",
org.eclipse.xtend.core;bundle-version="2.17.0",
org.eclipse.xtext.ui;bundle-version="2.17.0",
org.eclipse.xtext.xbase.ui;bundle-version="2.17.0",
org.eclipse.xtext.common.types.ui;bundle-version="2.17.0",
org.eclipse.ui.ide;bundle-version="3.14.100",
org.eclipse.core.filesystem;bundle-version="1.7.200",
org.eclipse.equinox.bidi;bundle-version="1.1.200",
Expand All @@ -29,10 +29,8 @@ Require-Bundle: io.sarl.lang.ui;bundle-version="0.9.0";visibility:=reexport,
org.eclipse.ui;bundle-version="3.110.0",
org.eclipse.ui.intro;bundle-version="3.5.300",
org.eclipse.ui.intro.quicklinks;bundle-version="1.0.300",
org.eclipse.ui.intro.universal;bundle-version="3.3.300",
org.arakhne.afc.core.vmutils;bundle-version="15.2.0",
com.google.gson;bundle-version="2.8.5",
com.google.inject;bundle-version="4.1.0"
com.google.gson;bundle-version="2.8.5"
Bundle-Activator: io.sarl.eclipse.SARLEclipsePlugin
Export-Package: io.sarl.eclipse,
io.sarl.eclipse.buildpath,
Expand Down
5 changes: 3 additions & 2 deletions main/coreplugins/io.sarl.eclipse/pom.xml
Expand Up @@ -7,8 +7,9 @@

<parent>
<groupId>io.sarl</groupId>
<artifactId>io.sarl.plugins.core</artifactId>
<version>0.9.0-SNAPSHOT</version>
<artifactId>io.sarl.tycho-parent-ui</artifactId>
<version>0.9.0-SNAPSHOT</version>
<relativePath>../../../tycho-parent/tycho-parent-ui</relativePath>
</parent>

<build>
Expand Down
2 changes: 1 addition & 1 deletion main/coreplugins/io.sarl.lang.core/META-INF/MANIFEST.MF
Expand Up @@ -6,7 +6,7 @@ Automatic-Module-Name: io.sarl.lang.core
Bundle-Version: 0.9.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.xtext.xbase.lib;bundle-version="2.15.0";visibility:=reexport,
Require-Bundle: org.eclipse.xtext.xbase.lib;bundle-version="2.17.0";visibility:=reexport,
javax.inject;bundle-version="1.0.0"
Export-Package: io.sarl.bootstrap,
io.sarl.lang,
Expand Down
Expand Up @@ -94,7 +94,7 @@ public final class SARLVersion {

/** The minimal Xtext version to use SARL features.
*/
public static final String MINIMAL_XTEXT_VERSION = "2.15.0"; //$NON-NLS-1$
public static final String MINIMAL_XTEXT_VERSION = "2.17.0"; //$NON-NLS-1$

private SARLVersion() {
//
Expand Down
20 changes: 10 additions & 10 deletions main/coreplugins/io.sarl.lang.mwe2/META-INF/MANIFEST.MF
Expand Up @@ -8,20 +8,20 @@ Automatic-Module-Name: io.sarl.lang.mwe2
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: io.sarl.lang.core;bundle-version="0.9.0",
org.eclipse.xtext.generator;bundle-version="2.15.0",
org.eclipse.xtext.xbase.ui;bundle-version="2.15.0",
org.eclipse.xtext.ui;bundle-version="2.15.0",
org.eclipse.xtend.ide;bundle-version="2.15.0",
org.eclipse.xtext.common.types.ui;bundle-version="2.15.0",
org.eclipse.xtend.core;bundle-version="2.15.0",
org.eclipse.xtext.ui.codetemplates.ui;bundle-version="2.15.0",
org.eclipse.xtext.builder;bundle-version="2.15.0",
org.eclipse.emf.mwe2.launch;bundle-version="2.9.1",
org.eclipse.xtext.generator;bundle-version="2.17.0",
org.eclipse.xtext.xbase.ui;bundle-version="2.17.0",
org.eclipse.xtext.ui;bundle-version="2.17.0",
org.eclipse.xtend.ide;bundle-version="2.17.0",
org.eclipse.xtext.common.types.ui;bundle-version="2.17.0",
org.eclipse.xtend.core;bundle-version="2.17.0",
org.eclipse.xtext.ui.codetemplates.ui;bundle-version="2.17.0",
org.eclipse.xtext.builder;bundle-version="2.17.0",
org.eclipse.emf.mwe2.launch;bundle-version="2.10.0",
org.apache.log4j;bundle-version="1.2.15",
org.eclipse.equinox.common;bundle-version="3.10.100",
org.eclipse.jdt.core;bundle-version="3.15.0",
org.apache.commons.logging;bundle-version="1.2.0",
org.objectweb.asm;bundle-version="6.2.1",
org.objectweb.asm;bundle-version="7.0.0",
aopalliance;bundle-version="1.0.0",
org.eclipse.compare;bundle-version="3.7.300"
Export-Package: io.sarl.lang.mwe2,
Expand Down
Expand Up @@ -598,6 +598,11 @@ Workflow {
provider = true
functionName = "configureCompilationUnitImpl"
}
runtime = {
bind = "org.eclipse.xtext.parser.antlr.IPartialParsingHelper"
to = "io.sarl.lang.compiler.SarlPartialParserHelper"
functionName = "bindIPartialParserHelper"
}

ui = {
bind = "io.sarl.lang.extralanguage.IExtraLanguageContributions"
Expand Down Expand Up @@ -680,6 +685,10 @@ Workflow {
bind = "org.eclipse.xtext.tasks.ITaskTagProvider"
to = "io.sarl.lang.ui.tasks.SarlTaskTagProvider"
}
ui = {
bind = "org.eclipse.xtext.tasks.ITaskFinder"
to = "io.sarl.lang.ui.tasks.SarlTaskFinder"
}
ui = {
bind = "org.eclipse.xtext.ui.editor.outline.impl.OutlineFilterAndSorter$IComparator"
to = "io.sarl.lang.ui.outline.SARLOutlineNodeComparator"
Expand Down Expand Up @@ -867,11 +876,6 @@ Workflow {
bind = "org.eclipse.xtext.xbase.conversion.XbaseValueConverterService$IntUnderscoreValueConverter"
to = "org.eclipse.xtend.core.conversion.IntUnderscoreValueConverter"
}
runtime = {
bind = "org.eclipse.xtext.parser.antlr.IPartialParsingHelper"
to = "org.eclipse.xtend.core.parser.XtendPartialParsingHelper"
functionName = "bindIPartialParserHelper"
}
runtime = {
bind = "org.eclipse.xtext.naming.IQualifiedNameProvider"
to = "org.eclipse.xtend.core.naming.XtendQualifiedNameProvider"
Expand Down
16 changes: 8 additions & 8 deletions main/coreplugins/io.sarl.lang.ui/META-INF/MANIFEST.MF
Expand Up @@ -7,14 +7,14 @@ Bundle-SymbolicName: io.sarl.lang.ui; singleton:=true
Automatic-Module-Name: io.sarl.lang.ui
Bundle-ActivationPolicy: lazy
Require-Bundle: io.sarl.lang;bundle-version="0.9.0";visibility:=reexport,
org.eclipse.xtext.ui;bundle-version="2.15.0",
org.eclipse.xtext.ui.shared;bundle-version="2.15.0",
org.eclipse.xtext.ui.codetemplates.ui;bundle-version="2.15.0",
org.eclipse.xtext.xbase.ui;bundle-version="2.15.0",
org.eclipse.xtext.builder;bundle-version="2.15.0",
org.eclipse.xtend.ide;bundle-version="2.15.0",
org.eclipse.xtend.core;bundle-version="2.15.0",
org.eclipse.xtext.common.types.ui;bundle-version="2.15.0",
org.eclipse.xtext.ui;bundle-version="2.17.0",
org.eclipse.xtext.ui.shared;bundle-version="2.17.0",
org.eclipse.xtext.ui.codetemplates.ui;bundle-version="2.17.0",
org.eclipse.xtext.xbase.ui;bundle-version="2.17.0",
org.eclipse.xtext.builder;bundle-version="2.17.0",
org.eclipse.xtend.ide;bundle-version="2.17.0",
org.eclipse.xtend.core;bundle-version="2.17.0",
org.eclipse.xtext.common.types.ui;bundle-version="2.17.0",
org.apache.log4j;bundle-version="1.2.15",
org.eclipse.jdt.core;bundle-version="3.15.0",
org.eclipse.jdt.ui;bundle-version="3.15.0",
Expand Down
2 changes: 1 addition & 1 deletion main/coreplugins/io.sarl.lang.ui/build.properties
Expand Up @@ -6,8 +6,8 @@ bin.includes = META-INF/,\
plugin.xml,\
OSGI-INF/,\
templates/,\
src-templates/,\
about.ini,\
about.mappings,\
about.properties
jre.compilation.profile = JavaSE-1.8
jars.compile.order = .
8 changes: 5 additions & 3 deletions main/coreplugins/io.sarl.lang.ui/pom.xml
@@ -1,11 +1,13 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.sarl</groupId>
<artifactId>io.sarl.plugins.core</artifactId>
<version>0.9.0-SNAPSHOT</version>
<artifactId>io.sarl.tycho-parent-ui</artifactId>
<version>0.9.0-SNAPSHOT</version>
<relativePath>../../../tycho-parent/tycho-parent-ui</relativePath>
</parent>

<artifactId>io.sarl.lang.ui</artifactId>
Expand Down
Expand Up @@ -80,6 +80,7 @@
import io.sarl.lang.ui.preferences.SARLValidatorConfigurationBlock;
import io.sarl.lang.ui.quickfix.SARLQuickfixProvider;
import io.sarl.lang.ui.refactoring.rename.SARLRenameStrategyProvider;
import io.sarl.lang.ui.tasks.SarlTaskFinder;
import io.sarl.lang.ui.tasks.SarlTaskTagProvider;
import io.sarl.lang.ui.validation.SARLUIStrings;
import io.sarl.lang.ui.validation.SARLUIValidator;
Expand Down Expand Up @@ -155,6 +156,7 @@
import org.eclipse.xtext.resource.containers.IAllContainersState;
import org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider;
import org.eclipse.xtext.service.SingletonBinding;
import org.eclipse.xtext.tasks.ITaskFinder;
import org.eclipse.xtext.tasks.ITaskTagProvider;
import org.eclipse.xtext.ui.IImageHelper;
import org.eclipse.xtext.ui.LanguageSpecific;
Expand Down Expand Up @@ -707,6 +709,11 @@ public Class<? extends XtendFieldBuilder> bindXtendFieldBuilder() {
return SarlFieldBuilder.class;
}

// contributed by io.sarl.lang.mwe2.binding.InjectionFragment2 [Bindings provided by SARL API]
public Class<? extends ITaskFinder> bindITaskFinder() {
return SarlTaskFinder.class;
}

// contributed by io.sarl.lang.mwe2.binding.InjectionFragment2 [Bindings provided by SARL API]
public void configureIPreferenceStoreInitializer(Binder binder) {
binder.bind(IPreferenceStoreInitializer.class).annotatedWith(Names.named("RefactoringPreferences")).to(SARLPreferenceStoreInitializer.class);
Expand Down
Expand Up @@ -79,6 +79,7 @@
* @mavenartifactid $ArtifactId$
* @see "https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#outline"
*/
@SuppressWarnings("checkstyle:classfanoutcomplexity")
public class SARLOutlineTreeProvider extends XbaseWithAnnotationsOutlineTreeProvider {

@Inject
Expand Down
@@ -0,0 +1,80 @@
/*
* $Id$
*
* SARL is an general-purpose agent programming language.
* More details on http://www.sarl.io
*
* Copyright (C) 2014-2019 the original authors or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.sarl.lang.ui.tasks;

import com.google.common.base.Objects;
import com.google.inject.Inject;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.RuleCall;
import org.eclipse.xtext.nodemodel.ILeafNode;
import org.eclipse.xtext.tasks.DefaultTaskFinder;
import org.eclipse.xtext.xbase.lib.Extension;

import io.sarl.lang.services.SARLGrammarAccess;

/** Finder for task tags.
*
* @author $Author: sgalland$
* @version $FullVersion$
* @mavengroupid $GroupId$
* @mavenartifactid $ArtifactId$
* @since 0.9
*/
public class SarlTaskFinder extends DefaultTaskFinder {

@Inject
@Extension
private SARLGrammarAccess grammarAccess;

@Override
protected boolean canContainTaskTags(final ILeafNode node) {
final boolean result = super.canContainTaskTags(node);
if (!result) {
return isRichComment(node);
}
return result;
}

@Override
protected String stripText(final ILeafNode node, final String text) {
final boolean isRichComment = isRichComment(node);
if (isRichComment) {
final char newLine = '\n';
final int index = text.indexOf(newLine);
if (index != -1) {
return text.substring(0, index);
}
return text;
}
return super.stripText(node, text);
}

private boolean isRichComment(final ILeafNode node) {
final EObject grammarElement = node.getGrammarElement();
if (grammarElement instanceof RuleCall) {
return Objects.equal(((RuleCall) node.getGrammarElement()).getRule(), this.grammarAccess.getCOMMENT_RICH_TEXT_ENDRule())
|| Objects.equal(((RuleCall) node.getGrammarElement()).getRule(), this.grammarAccess.getCOMMENT_RICH_TEXT_INBETWEENRule());
}
return false;
}

}

0 comments on commit f734300

Please sign in to comment.