File tree 2 files changed +11
-4
lines changed
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 12
12
*******************************************************************************/
13
13
package org .eclipse .jdt .ls .core .internal ;
14
14
15
- import java .util .Arrays ;
16
15
import java .util .List ;
16
+ import java .util .Map ;
17
+ import java .util .TreeMap ;
17
18
import java .util .stream .Collectors ;
18
19
19
20
import org .eclipse .core .runtime .IConfigurationElement ;
26
27
*
27
28
*/
28
29
public class ExtensionsExtractor {
29
- public static <T > List <T > extractExtensions (final String namespace , final String extensionPointName ) {
30
+ public static <T > List <T > extractOrderedExtensions (final String namespace , final String extensionPointName ) {
30
31
31
32
final var extensionPoint = Platform .getExtensionRegistry ().getExtensionPoint (namespace , extensionPointName );
32
33
final var configs = extensionPoint .getConfigurationElements ();
33
34
34
- return Arrays .stream (configs ).map (ExtensionsExtractor ::<T >makeExtension ).collect (Collectors .toUnmodifiableList ());
35
+ Map <Integer , T > extensionMap = new TreeMap <>();
36
+
37
+ for (int i = 0 ; i < configs .length ; i ++) {
38
+ Integer order = Integer .valueOf (configs [i ].getAttribute ("order" ));
39
+ extensionMap .put (order , makeExtension (configs [i ]));
40
+ }
41
+ return extensionMap .values ().stream ().collect (Collectors .toUnmodifiableList ());
35
42
}
36
43
37
44
@ SuppressWarnings ("unchecked" )
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ private BuildSupportManager() {}
37
37
38
38
public static List <IBuildSupport > obtainBuildSupports () {
39
39
if (instance .lazyLoadedBuildSupportList == null ) {
40
- instance .lazyLoadedBuildSupportList = ExtensionsExtractor .extractExtensions (IConstants .PLUGIN_ID , "buildSupport" );
40
+ instance .lazyLoadedBuildSupportList = ExtensionsExtractor .extractOrderedExtensions (IConstants .PLUGIN_ID , "buildSupport" );
41
41
}
42
42
43
43
return instance .lazyLoadedBuildSupportList ;
You can’t perform that action at this time.
0 commit comments