@@ -19,7 +19,7 @@ import { IEditorTracker } from '@jupyterlab/fileeditor';
19
19
import { CodeMirrorEditor } from '@jupyterlab/codemirror' ;
20
20
import { INotebookTracker } from '@jupyterlab/notebook' ;
21
21
import { IDocumentManager } from '@jupyterlab/docmanager' ;
22
- import { ILSPFeatureManager , PLUGIN_ID } from '../tokens' ;
22
+ import { ILSPAdapterManager , ILSPFeatureManager , PLUGIN_ID } from '../tokens' ;
23
23
import { LabIcon } from '@jupyterlab/ui-components' ;
24
24
import jumpToSvg from '../../style/icons/jump-to.svg' ;
25
25
@@ -102,7 +102,6 @@ export class CMJumpToDefinition extends CodeMirrorIntegration {
102
102
// otherwise there is no virtual document and we expect the returned position to be source position:
103
103
let source_position_ce = PositionConverter . cm_to_ce ( virtual_position ) ;
104
104
console . log ( `Jumping to external file: ${ uri } ` ) ;
105
-
106
105
console . log ( 'Jump target (source location):' , source_position_ce ) ;
107
106
108
107
// can it be resolved vs our guessed server root?
@@ -143,19 +142,18 @@ export class CMJumpToDefinition extends CodeMirrorIntegration {
143
142
}
144
143
145
144
class JumperLabIntegration implements IFeatureLabIntegration {
146
- private fileEditorTracker : IEditorTracker ;
147
- private notebookTracker : INotebookTracker ;
145
+ private adapterManager : ILSPAdapterManager ;
148
146
private jumpers : Map < string , CodeJumper > ;
149
147
// settings should be implemented in the future
150
148
settings ?: FeatureSettings < any > ;
151
149
152
150
constructor (
151
+ adapterManager : ILSPAdapterManager ,
153
152
fileEditorTracker : IEditorTracker ,
154
153
notebookTracker : INotebookTracker ,
155
154
documentManager : IDocumentManager
156
155
) {
157
- this . fileEditorTracker = fileEditorTracker ;
158
- this . notebookTracker = notebookTracker ;
156
+ this . adapterManager = adapterManager ;
159
157
this . jumpers = new Map ( ) ;
160
158
161
159
fileEditorTracker . widgetAdded . connect ( ( sender , widget ) => {
@@ -175,9 +173,7 @@ class JumperLabIntegration implements IFeatureLabIntegration {
175
173
}
176
174
177
175
get jumper ( ) : CodeJumper {
178
- let current =
179
- this . notebookTracker . currentWidget . id ||
180
- this . fileEditorTracker . currentWidget . id ;
176
+ let current = this . adapterManager . currentAdapter . widget . id ;
181
177
return this . jumpers . get ( current ) ;
182
178
}
183
179
}
@@ -204,6 +200,7 @@ export const JUMP_PLUGIN: JupyterFrontEndPlugin<void> = {
204
200
id : FEATURE_ID ,
205
201
requires : [
206
202
ILSPFeatureManager ,
203
+ ILSPAdapterManager ,
207
204
IEditorTracker ,
208
205
INotebookTracker ,
209
206
IDocumentManager
@@ -212,11 +209,13 @@ export const JUMP_PLUGIN: JupyterFrontEndPlugin<void> = {
212
209
activate : (
213
210
app : JupyterFrontEnd ,
214
211
featureManager : ILSPFeatureManager ,
212
+ adapterManager : ILSPAdapterManager ,
215
213
fileEditorTracker : IEditorTracker ,
216
214
notebookTracker : INotebookTracker ,
217
215
documentManager : IDocumentManager
218
216
) => {
219
217
let labIntegration = new JumperLabIntegration (
218
+ adapterManager ,
220
219
fileEditorTracker ,
221
220
notebookTracker ,
222
221
documentManager
0 commit comments