Enable members sorting in file structure view
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2013 JetBrains s.r.o.
|
* Copyright 2010-2014 JetBrains s.r.o.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -17,13 +17,22 @@
|
|||||||
package org.jetbrains.jet.plugin.structureView;
|
package org.jetbrains.jet.plugin.structureView;
|
||||||
|
|
||||||
import com.intellij.ide.structureView.StructureViewModelBase;
|
import com.intellij.ide.structureView.StructureViewModelBase;
|
||||||
|
import com.intellij.ide.util.treeView.smartTree.Sorter;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.jet.lang.psi.JetDeclaration;
|
import org.jetbrains.jet.lang.psi.JetDeclaration;
|
||||||
import org.jetbrains.jet.lang.psi.JetFile;
|
import org.jetbrains.jet.lang.psi.JetFile;
|
||||||
|
|
||||||
public class JetStructureViewModel extends StructureViewModelBase {
|
public class JetStructureViewModel extends StructureViewModelBase {
|
||||||
|
private static final Sorter[] sorters = new Sorter[] {Sorter.ALPHA_SORTER};
|
||||||
|
|
||||||
public JetStructureViewModel(@NotNull JetFile jetFile) {
|
public JetStructureViewModel(@NotNull JetFile jetFile) {
|
||||||
super(jetFile, new JetStructureViewElement(jetFile));
|
super(jetFile, new JetStructureViewElement(jetFile));
|
||||||
withSuitableClasses(JetDeclaration.class);
|
withSuitableClasses(JetDeclaration.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Sorter[] getSorters() {
|
||||||
|
return sorters;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
-InheritedMembers.kt
|
-InheritedMembers.kt
|
||||||
Test (<root>)
|
Test
|
||||||
|
|||||||
@@ -1,15 +1,4 @@
|
|||||||
-Render.kt
|
-Render.kt
|
||||||
test1(): Unit
|
|
||||||
test2(String?): Unit
|
|
||||||
test3(T, U): Unit
|
|
||||||
test4(T): Unit
|
|
||||||
test5(): String
|
|
||||||
test6(): Comparable<String>
|
|
||||||
extension1() on String: Unit
|
|
||||||
extension2() on Comparable<T>: Unit
|
|
||||||
a: Int
|
|
||||||
a: String on Comparable<T>
|
|
||||||
b: Any
|
|
||||||
A1
|
A1
|
||||||
-A2
|
-A2
|
||||||
a: Int
|
a: Int
|
||||||
@@ -26,15 +15,26 @@
|
|||||||
-<class object>
|
-<class object>
|
||||||
test(): Unit
|
test(): Unit
|
||||||
-A7
|
-A7
|
||||||
a: Int
|
|
||||||
<class initializer>
|
<class initializer>
|
||||||
|
a: Int
|
||||||
|
a: Int
|
||||||
|
a: String on Comparable<T>
|
||||||
|
b: Any
|
||||||
-Enum1 : Enum<Enum1>
|
-Enum1 : Enum<Enum1>
|
||||||
FIRST : Enum1
|
FIRST : Enum1
|
||||||
SECOND : Enum1
|
SECOND : Enum1
|
||||||
Trait
|
extension1() on String: Unit
|
||||||
Trait1 : Trait
|
extension2() on Comparable<T>: Unit
|
||||||
|
test1(): Unit
|
||||||
|
test2(String?): Unit
|
||||||
|
test3(T, U): Unit
|
||||||
|
test4(T): Unit
|
||||||
|
test5(): String
|
||||||
|
test6(): Comparable<String>
|
||||||
TestWithWhere
|
TestWithWhere
|
||||||
testWithWhere(): Unit
|
testWithWhere(): Unit
|
||||||
|
Trait
|
||||||
|
Trait1 : Trait
|
||||||
|
withDefaulArgs(Int = ..., String = ...): Unit
|
||||||
-WithDefaultArgs
|
-WithDefaultArgs
|
||||||
a: Int
|
a: Int
|
||||||
withDefaulArgs(Int = ..., String = ...): Unit
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-SeveralClasses.kt
|
-SeveralClasses.kt
|
||||||
A
|
A
|
||||||
B
|
B
|
||||||
Some : B, A
|
|
||||||
Other : A
|
Other : A
|
||||||
|
Some : B, A
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
-Simple.kt
|
-Simple.kt
|
||||||
-Test
|
-Test
|
||||||
str: String
|
|
||||||
some: Int
|
|
||||||
foo(): Int
|
foo(): Int
|
||||||
other(): Unit
|
other(): Unit
|
||||||
|
some: Int
|
||||||
|
str: String
|
||||||
|
|||||||
Reference in New Issue
Block a user