@@ -103,16 +103,16 @@ class CodeLensContentWidget implements EditorBrowser.IContentWidget {
103103 }
104104 }
105105
106- public withCommands ( commands : Modes . ICommand [ ] ) : void {
106+ public withCommands ( symbols : Modes . ICodeLensSymbol [ ] ) : void {
107107 this . _commands = Object . create ( null ) ;
108- if ( ! commands || ! commands . length ) {
108+ if ( ! symbols || ! symbols . length ) {
109109 this . _domNode . innerHTML = 'no commands' ;
110110 return ;
111111 }
112112
113113 let html : string [ ] = [ ] ;
114- for ( let i = 0 ; i < commands . length ; i ++ ) {
115- let command = commands [ i ] ;
114+ for ( let i = 0 ; i < symbols . length ; i ++ ) {
115+ let command = symbols [ i ] . command ;
116116 let part : string ;
117117 if ( command . id ) {
118118 part = format ( '<a id={0}>{1}</a>' , i , command . title ) ;
@@ -303,8 +303,8 @@ class CodeLens {
303303 return this . _data ;
304304 }
305305
306- public updateCommands ( commands : Modes . ICommand [ ] , currentModelsVersionId : number ) : void {
307- this . _contentWidget . withCommands ( commands ) ;
306+ public updateCommands ( symbols : Modes . ICodeLensSymbol [ ] , currentModelsVersionId : number ) : void {
307+ this . _contentWidget . withCommands ( symbols ) ;
308308 this . _lastUpdateModelsVersionId = currentModelsVersionId ;
309309 }
310310
@@ -616,17 +616,15 @@ export class CodeLensContribution implements EditorCommon.IEditorContribution {
616616 var resource = model . getAssociatedResource ( ) ;
617617 var promises = toResolve . map ( ( request , i ) => {
618618
619- let commands = new Array < Modes . ICommand > ( request . length ) ;
619+ let resolvedSymbols = new Array < Modes . ICodeLensSymbol > ( request . length ) ;
620620 let promises = request . map ( ( request , i ) => {
621- return request . support . resolveCodeLensSymbol ( resource , request . symbol ) . then ( command => {
622- if ( command ) {
623- commands [ i ] = command ;
624- }
621+ return request . support . resolveCodeLensSymbol ( resource , request . symbol ) . then ( symbol => {
622+ resolvedSymbols [ i ] = symbol ;
625623 } ) ;
626624 } ) ;
627625
628626 return TPromise . join ( promises ) . then ( ( ) => {
629- lenses [ i ] . updateCommands ( commands , currentModelsVersionId ) ;
627+ lenses [ i ] . updateCommands ( resolvedSymbols , currentModelsVersionId ) ;
630628 } )
631629 } ) ;
632630
0 commit comments