Skip to content

Commit

Permalink
[lang][ui] Share the "Auto-generated action" message.
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 Jan 8, 2015
1 parent 4f0eea3 commit 8a1c1cd
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 13 deletions.
Expand Up @@ -52,7 +52,6 @@ public class Messages extends NLS {
public static String SARLQuickfixProvider_17;
public static String SARLQuickfixProvider_18;
public static String SARLQuickfixProvider_19;
public static String SARLQuickfixProvider_20;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
Expand Down
Expand Up @@ -724,7 +724,7 @@ class SARLQuickfixProvider extends XbaseQuickfixProvider {
if (issue.data!=null && issue.data.length==2) {
val expectedType = issue.data.get(1)
var msg = MessageFormat::format(
Messages::SARLQuickfixProvider_18,
Messages::SARLQuickfixProvider_17,
Messages::SARLQuickfixProvider_11,
expectedType)
acceptor.accept(issue, msg, msg, null) [ element, context |
Expand All @@ -737,12 +737,12 @@ class SARLQuickfixProvider extends XbaseQuickfixProvider {
@Fix(IssueCodes.INVALID_USE_OF_VAR_ARG)
def fixNoDefaultValueForVariadicParameter(Issue issue, IssueResolutionAcceptor acceptor) {
var String msg
msg = Messages::SARLQuickfixProvider_19
msg = Messages::SARLQuickfixProvider_18
acceptor.accept(issue, msg, msg, null) [ element, context |
var document = context.xtextDocument
removeElementWithPreviousSpaces(issue, document)
]
msg = Messages::SARLQuickfixProvider_20
msg = Messages::SARLQuickfixProvider_19
acceptor.accept(issue, msg, msg, null) [ element, context |
var container = EcoreUtil2.getContainerOfType(element, typeof(ParameterizedFeature))
if (container!==null && !container.params.empty) {
Expand Down
Expand Up @@ -15,7 +15,6 @@ SARLQuickfixProvider_13=Add the {0} ''{1}''
SARLQuickfixProvider_14=- {0}\n
SARLQuickfixProvider_15=Add the following unimplemented actions:\n{0}
SARLQuickfixProvider_16=Add unimplemented actions
SARLQuickfixProvider_17=Auto-generated action.
SARLQuickfixProvider_18=Replace the {0} by ''{1}''
SARLQuickfixProvider_19=Remove the variadic parameter
SARLQuickfixProvider_20=Remove the default value
SARLQuickfixProvider_17=Replace the {0} by ''{1}''
SARLQuickfixProvider_18=Remove the variadic parameter
SARLQuickfixProvider_19=Remove the default value
44 changes: 44 additions & 0 deletions plugins/io.sarl.lang/src/io/sarl/lang/genmodel/Messages.java
@@ -0,0 +1,44 @@
/*
* $Id$
*
* SARL is an general-purpose agent programming language.
* More details on http://www.sarl.io
*
* Copyright (C) 2014 Sebastian RODRIGUEZ, Nicolas GAUD, Stéphane GALLAND.
*
* 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.genmodel;

import org.eclipse.osgi.util.NLS;

/** Localized Messages.
* @author $Author: sgalland$
* @version $FullVersion$
* @mavengroupid $GroupId$
* @mavenartifactid $ArtifactId$
*/
@SuppressWarnings("all")
public class Messages extends NLS {
private static final String BUNDLE_NAME = "io.sarl.lang.genmodel.messages"; //$NON-NLS-1$
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}

private Messages() {
}

public static String SARLCodeGenerator_0;
}
@@ -0,0 +1 @@
SARLCodeGenerator_0=Auto-generated action.
Expand Up @@ -1387,13 +1387,13 @@ public void fixMissingMethodImplementation_0() {
+ "}\n"
+ "skill S1 implements C1 {\n"
+ "\tdef fct1 {\n"
+ "\t\t// TODO: Auto-generated action.\n"
+ "\t\t// TODO Auto-generated action.\n"
+ "\t}\n"
+ "\tdef fct2(a : int) {\n"
+ "\t\t// TODO: Auto-generated action.\n"
+ "\t\t// TODO Auto-generated action.\n"
+ "\t}\n"
+ "\tdef fct3 : boolean {\n"
+ "\t\t// TODO: Auto-generated action.\n"
+ "\t\t// TODO Auto-generated action.\n"
+ "\t\ttrue\n"
+ "\t}\n"
+ "}\n");
Expand Down Expand Up @@ -1434,10 +1434,10 @@ public void fixMissingMethodImplementation_1() {
+ "skill S1 implements C1 {\n"
+ "\tdef fct2(b : int) { }\n"
+ "\tdef fct1 {\n"
+ "\t\t// TODO: Auto-generated action.\n"
+ "\t\t// TODO Auto-generated action.\n"
+ "\t}\n"
+ "\tdef fct3 : boolean {\n"
+ "\t\t// TODO: Auto-generated action.\n"
+ "\t\t// TODO Auto-generated action.\n"
+ "\t\ttrue\n"
+ "\t}\n"
+ "}\n");
Expand Down

0 comments on commit 8a1c1cd

Please sign in to comment.