@@ -126,30 +126,34 @@ class StickyScrollController implements IEditorContribution {
126
126
this . _ranges = [ ] ;
127
127
for ( const outline of outlineModel . children . values ( ) ) {
128
128
if ( outline instanceof OutlineElement ) {
129
- this . _findLineRanges ( outline , 1 ) ;
129
+ const kind : SymbolKind = outline . symbol . kind ;
130
+ if ( kind === SymbolKind . Class || kind === SymbolKind . Constructor || kind === SymbolKind . Function || kind === SymbolKind . Interface || kind === SymbolKind . Method ) {
131
+ this . _findLineRanges ( outline , 1 ) ;
132
+ } else {
133
+ this . _findLineRanges ( outline , 0 ) ;
134
+ }
130
135
}
131
- }
132
- this . _ranges = this . _ranges . sort ( function ( a , b ) {
133
- if ( a [ 0 ] !== b [ 0 ] ) {
134
- return a [ 0 ] - b [ 0 ] ;
135
- } else if ( a [ 1 ] !== b [ 1 ] ) {
136
- return b [ 1 ] - a [ 1 ] ;
137
- } else {
138
- return a [ 2 ] - b [ 2 ] ;
139
- }
140
- } ) ;
141
- let previous : number [ ] = [ ] ;
142
- for ( const [ index , arr ] of this . _ranges . entries ( ) ) {
143
- const [ start , end , _depth ] = arr ;
144
- if ( previous [ 0 ] === start && previous [ 1 ] === end ) {
145
- this . _ranges . splice ( index , 1 ) ;
146
- } else {
147
- previous = arr ;
136
+ this . _ranges = this . _ranges . sort ( function ( a , b ) {
137
+ if ( a [ 0 ] !== b [ 0 ] ) {
138
+ return a [ 0 ] - b [ 0 ] ;
139
+ } else if ( a [ 1 ] !== b [ 1 ] ) {
140
+ return b [ 1 ] - a [ 1 ] ;
141
+ } else {
142
+ return a [ 2 ] - b [ 2 ] ;
143
+ }
144
+ } ) ;
145
+ let previous : number [ ] = [ ] ;
146
+ for ( const [ index , arr ] of this . _ranges . entries ( ) ) {
147
+ const [ start , end , _depth ] = arr ;
148
+ if ( previous [ 0 ] === start && previous [ 1 ] === end ) {
149
+ this . _ranges . splice ( index , 1 ) ;
150
+ } else {
151
+ previous = arr ;
152
+ }
148
153
}
149
154
}
150
155
}
151
156
}
152
-
153
157
private _renderStickyScroll ( ) {
154
158
155
159
if ( ! ( this . _editor . hasModel ( ) ) ) {
0 commit comments