use of org.eclipse.xtext.preferences.PreferenceKey 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;
}
use of org.eclipse.xtext.preferences.PreferenceKey in project xtext-core by eclipse.
the class FormatterPreferenceValuesProvider method getPreferenceValues.
@Override
public IPreferenceValues getPreferenceValues(final Resource resource) {
final IPreferenceValues preferenceValues = internalGetRawPreferenceValues(resource);
final String indent = whitespaceInfo.getIndentationInformation(resource.getURI()).getIndentString();
final String lineSep = whitespaceInfo.getLineSeparatorInformation(resource.getURI()).getLineSeparator();
return new IPreferenceValues() {
@Override
public String getPreference(PreferenceKey key) {
if (key == FormatterPreferenceKeys.indentation) {
return indent;
}
if (key == FormatterPreferenceKeys.lineSeparator) {
return lineSep;
}
return preferenceValues.getPreference(key);
}
};
}
Aggregations