Search in sources :

Example 1 with TaskTags

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

the class DefaultTaskTagProvider method getTaskTags.

@Override
public TaskTags getTaskTags(final Resource resouce) {
    TaskTags _taskTags = new TaskTags();
    final Procedure1<TaskTags> _function = (TaskTags it) -> {
        it.setCaseSensitive(true);
        List<TaskTag> _taskTags_1 = it.getTaskTags();
        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);
        TaskTag _taskTag_1 = 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_1, _function_2);
        TaskTag _taskTag_2 = new TaskTag();
        final Procedure1<TaskTag> _function_3 = (TaskTag it_1) -> {
            it_1.setName("XXX");
            it_1.setPriority(Priority.NORMAL);
        };
        TaskTag _doubleArrow_2 = ObjectExtensions.<TaskTag>operator_doubleArrow(_taskTag_2, _function_3);
        Iterables.<TaskTag>addAll(_taskTags_1, Collections.<TaskTag>unmodifiableList(CollectionLiterals.<TaskTag>newArrayList(_doubleArrow, _doubleArrow_1, _doubleArrow_2)));
    };
    return ObjectExtensions.<TaskTags>operator_doubleArrow(_taskTags, _function);
}
Also used : TaskTag(org.eclipse.xtext.tasks.TaskTag) Procedure1(org.eclipse.xtext.xbase.lib.Procedures.Procedure1) TaskTags(org.eclipse.xtext.tasks.TaskTags) List(java.util.List)

Example 2 with TaskTags

use of org.eclipse.xtext.tasks.TaskTags in project statecharts by Yakindu.

the class STextTaskFinder method findTasks.

public List<Task> findTasks(StextResource resource) {
    TaskTags taskTags = taskTagProvider.getTaskTags(resource);
    List<Task> result = Lists.newArrayList();
    TreeIterator<EObject> allContents = resource.getAllContents();
    while (allContents.hasNext()) {
        EObject eObject = (EObject) allContents.next();
        if (eObject instanceof SpecificationElement) {
            List<Task> parseTasks = parseTasks(eObject, SGraphPackage.Literals.SPECIFICATION_ELEMENT__SPECIFICATION, taskTags);
            result.addAll(parseTasks);
        }
        if (eObject instanceof DocumentedElement) {
            result.addAll(parseTasks(eObject, BasePackage.Literals.DOCUMENTED_ELEMENT__DOCUMENTATION, taskTags));
        }
    }
    return result;
}
Also used : DocumentedElement(org.yakindu.base.base.DocumentedElement) SCTTask(org.yakindu.sct.model.stext.tasks.SCTTask) Task(org.eclipse.xtext.tasks.Task) SpecificationElement(org.yakindu.sct.model.sgraph.SpecificationElement) EObject(org.eclipse.emf.ecore.EObject) TaskTags(org.eclipse.xtext.tasks.TaskTags)

Example 3 with TaskTags

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

the class XtendTaskTagProvider method getTaskTags.

@Override
public TaskTags getTaskTags(final Resource resource) {
    TaskTags _xblockexpression = null;
    {
        final IPreferenceValues prefs = this.preferenceValuesProvider.getPreferenceValues(resource);
        PreferenceKey _preferenceKey = new PreferenceKey(JavaCore.COMPILER_TASK_TAGS, "TODO,FIXME,XXX");
        final String namePref = prefs.getPreference(_preferenceKey);
        PreferenceKey _preferenceKey_1 = new PreferenceKey(JavaCore.COMPILER_TASK_PRIORITIES, "NORMAL,HIGH,NORMAL");
        final String prioritiesPref = prefs.getPreference(_preferenceKey_1);
        PreferenceKey _preferenceKey_2 = new PreferenceKey(JavaCore.COMPILER_TASK_CASE_SENSITIVE, JavaCore.ENABLED);
        final String caseSensitivePref = prefs.getPreference(_preferenceKey_2);
        final List<TaskTag> tags = PreferenceTaskTagProvider.parseTags(namePref, prioritiesPref);
        TaskTags _taskTags = new TaskTags();
        final Procedure1<TaskTags> _function = (TaskTags it) -> {
            List<TaskTag> _taskTags_1 = it.getTaskTags();
            Iterables.<TaskTag>addAll(_taskTags_1, tags);
            it.setCaseSensitive(caseSensitivePref.equals(JavaCore.ENABLED));
        };
        _xblockexpression = ObjectExtensions.<TaskTags>operator_doubleArrow(_taskTags, _function);
    }
    return _xblockexpression;
}
Also used : TaskTag(org.eclipse.xtext.tasks.TaskTag) IPreferenceValues(org.eclipse.xtext.preferences.IPreferenceValues) Procedure1(org.eclipse.xtext.xbase.lib.Procedures.Procedure1) TaskTags(org.eclipse.xtext.tasks.TaskTags) PreferenceKey(org.eclipse.xtext.preferences.PreferenceKey) List(java.util.List)

Aggregations

TaskTags (org.eclipse.xtext.tasks.TaskTags)3 List (java.util.List)2 TaskTag (org.eclipse.xtext.tasks.TaskTag)2 Procedure1 (org.eclipse.xtext.xbase.lib.Procedures.Procedure1)2 EObject (org.eclipse.emf.ecore.EObject)1 IPreferenceValues (org.eclipse.xtext.preferences.IPreferenceValues)1 PreferenceKey (org.eclipse.xtext.preferences.PreferenceKey)1 Task (org.eclipse.xtext.tasks.Task)1 DocumentedElement (org.yakindu.base.base.DocumentedElement)1 SpecificationElement (org.yakindu.sct.model.sgraph.SpecificationElement)1 SCTTask (org.yakindu.sct.model.stext.tasks.SCTTask)1