mirror of
https://github.com/peterdell/wudsn-ide.git
synced 2024-06-03 06:29:35 +00:00
Sort identifiers in outline based based on
CompilerSyntax.areIdentifiersCaseSensitive
This commit is contained in:
parent
7bb0cff770
commit
3db927c9f1
|
@ -152,12 +152,16 @@ public final class LanguageOutlinePage extends ContentOutlinePage {
|
|||
|
||||
private static final class OutlineViewerComparator extends ViewerComparator {
|
||||
private final OutlineViewerSortAction sortAction;
|
||||
private final boolean identifiersCaseSensitive;
|
||||
|
||||
OutlineViewerComparator(OutlineViewerSortAction sortAction) {
|
||||
if (sortAction == null) {
|
||||
throw new IllegalArgumentException("Parameter 'sortAction' must not be null.");
|
||||
}
|
||||
this.sortAction = sortAction;
|
||||
identifiersCaseSensitive = sortAction.editor.getCompilerDefinition().getSyntax()
|
||||
.areIdentifiersCaseSensitive();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -246,8 +250,12 @@ public final class LanguageOutlinePage extends ContentOutlinePage {
|
|||
name2 = "";//$NON-NLS-1$
|
||||
}
|
||||
|
||||
// Use direct comparison as identified are ASCII only.
|
||||
return name1.compareTo(name2);
|
||||
// Use direct comparison as identifier are ASCII only.
|
||||
if (identifiersCaseSensitive) {
|
||||
return name1.compareTo(name2);
|
||||
} else {
|
||||
return name1.compareToIgnoreCase(name2);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -282,8 +290,8 @@ public final class LanguageOutlinePage extends ContentOutlinePage {
|
|||
}
|
||||
|
||||
/**
|
||||
* Triggers a new {@link LanguageOutlineTreeContentProvider#parse} run
|
||||
* and updates the display.
|
||||
* Triggers a new {@link LanguageOutlineTreeContentProvider#parse} run and
|
||||
* updates the display.
|
||||
*/
|
||||
@Override
|
||||
protected void runWithLogging() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user