Search in sources :

Example 6 with TaskTag

use of org.eclipse.xtext.tasks.TaskTag in project xtext-core by eclipse.

the class DefaultTaskParserTest method testCaseInSensitive.

@Test
public void testCaseInSensitive() {
    this.definitions.setCaseSensitive(false);
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("/*");
    _builder.newLine();
    _builder.append(" ");
    _builder.append("* FixMe case insensitve match");
    _builder.newLine();
    _builder.append(" ");
    _builder.append("*/");
    _builder.newLine();
    Task _task = new Task();
    final Procedure1<Task> _function = (Task it) -> {
        TaskTag _taskTag = new TaskTag();
        final Procedure1<TaskTag> _function_1 = (TaskTag it_1) -> {
            it_1.setName("FIXME");
            it_1.setPriority(Priority.HIGH);
        };
        TaskTag _doubleArrow = ObjectExtensions.<TaskTag>operator_doubleArrow(_taskTag, _function_1);
        it.setTag(_doubleArrow);
        it.setDescription(" case insensitve match");
        it.setLineNumber(2);
        it.setOffset(6);
    };
    Task _doubleArrow = ObjectExtensions.<Task>operator_doubleArrow(_task, _function);
    this.assertContainsTasks(_builder, Collections.<Task>unmodifiableList(CollectionLiterals.<Task>newArrayList(_doubleArrow)));
}
Also used : Task(org.eclipse.xtext.tasks.Task) TaskTag(org.eclipse.xtext.tasks.TaskTag) Procedure1(org.eclipse.xtext.xbase.lib.Procedures.Procedure1) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Test(org.junit.Test)

Example 7 with TaskTag

use of org.eclipse.xtext.tasks.TaskTag in project xtext-xtend by eclipse.

the class XtendTaskFinderTest method test.

@Test
public void test() {
    try {
        StringConcatenation _builder = new StringConcatenation();
        _builder.append("package foo");
        _builder.newLine();
        _builder.newLine();
        _builder.append("class Foo {");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("def foo() {");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("\'\'\'", "\t\t");
        _builder.newLineIfNotEmpty();
        _builder.append("\t\t");
        _builder.append("�", "\t\t");
        _builder.append("�", "\t\t");
        _builder.append("�", "\t\t");
        _builder.append(" TODO this is a todo");
        _builder.newLineIfNotEmpty();
        _builder.append("\t\t");
        _builder.append("TODO this is not a todo");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("�", "\t\t");
        _builder.append("�", "\t\t");
        _builder.append("�", "\t\t");
        _builder.append(" FIXME this is a fixme");
        _builder.newLineIfNotEmpty();
        _builder.append("\t\t");
        _builder.append("\'\'\'", "\t\t");
        _builder.newLineIfNotEmpty();
        _builder.append("\t");
        _builder.append("}");
        _builder.newLine();
        _builder.append("}");
        _builder.newLine();
        final String contents = Strings.toUnixLineSeparator(_builder.toString());
        final XtendFile file = this.file(contents);
        Task _task = new Task();
        final Procedure1<Task> _function = (Task it) -> {
            TaskTag _taskTag = new TaskTag();
            final Procedure1<TaskTag> _function_1 = (TaskTag it_1) -> {
                it_1.setName("TODO");
                it_1.setPriority(Priority.NORMAL);
            };
            TaskTag _doubleArrow = ObjectExtensions.<TaskTag>operator_doubleArrow(_taskTag, _function_1);
            it.setTag(_doubleArrow);
            it.setDescription(" this is a todo");
            it.setOffset(50);
            it.setLineNumber(6);
        };
        Task _doubleArrow = ObjectExtensions.<Task>operator_doubleArrow(_task, _function);
        Task _task_1 = new Task();
        final Procedure1<Task> _function_1 = (Task it) -> {
            TaskTag _taskTag = new TaskTag();
            final Procedure1<TaskTag> _function_2 = (TaskTag it_1) -> {
                it_1.setName("FIXME");
                it_1.setPriority(Priority.HIGH);
            };
            TaskTag _doubleArrow_1 = ObjectExtensions.<TaskTag>operator_doubleArrow(_taskTag, _function_2);
            it.setTag(_doubleArrow_1);
            it.setDescription(" this is a fixme");
            it.setOffset(102);
            it.setLineNumber(8);
        };
        Task _doubleArrow_1 = ObjectExtensions.<Task>operator_doubleArrow(_task_1, _function_1);
        this.assertContainsTasks(file.eResource(), Collections.<Task>unmodifiableList(CollectionLiterals.<Task>newArrayList(_doubleArrow, _doubleArrow_1)));
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : XtendFile(org.eclipse.xtend.core.xtend.XtendFile) Task(org.eclipse.xtext.tasks.Task) TaskTag(org.eclipse.xtext.tasks.TaskTag) Procedure1(org.eclipse.xtext.xbase.lib.Procedures.Procedure1) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Test(org.junit.Test)

Example 8 with TaskTag

use of org.eclipse.xtext.tasks.TaskTag in project xtext-eclipse by eclipse.

the class TaskTagInputDialog method getResult.

public TaskTag getResult() {
    TaskTag task = new TaskTag();
    task.setName(nameField.getText().trim());
    switch(priorityField.getSelectionIndex()) {
        case 0:
            task.setPriority(Priority.HIGH);
            break;
        case 1:
            task.setPriority(Priority.NORMAL);
            break;
        default:
            task.setPriority(Priority.LOW);
            break;
    }
    return task;
}
Also used : TaskTag(org.eclipse.xtext.tasks.TaskTag)

Aggregations

TaskTag (org.eclipse.xtext.tasks.TaskTag)8 Procedure1 (org.eclipse.xtext.xbase.lib.Procedures.Procedure1)7 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)5 Task (org.eclipse.xtext.tasks.Task)5 Test (org.junit.Test)5 List (java.util.List)2 TaskTags (org.eclipse.xtext.tasks.TaskTags)2 XtendFile (org.eclipse.xtend.core.xtend.XtendFile)1 IPreferenceValues (org.eclipse.xtext.preferences.IPreferenceValues)1 PreferenceKey (org.eclipse.xtext.preferences.PreferenceKey)1 DefaultTaskFinder (org.eclipse.xtext.tasks.DefaultTaskFinder)1