@@ -2,6 +2,7 @@ import * as vscode from 'vscode';
2
2
import { EJSON } from 'bson' ;
3
3
4
4
import ActiveConnectionCodeLensProvider from './activeConnectionCodeLensProvider' ;
5
+ import CodeActionProvider from './codeActionProvider' ;
5
6
import ConnectionController from '../connectionController' ;
6
7
import CollectionDocumentsCodeLensProvider from './collectionDocumentsCodeLensProvider' ;
7
8
import CollectionDocumentsOperationsStore from './collectionDocumentsOperationsStore' ;
@@ -22,7 +23,6 @@ import MongoDBDocumentService, {
22
23
DOCUMENT_SOURCE_URI_IDENTIFIER ,
23
24
VIEW_DOCUMENT_SCHEME
24
25
} from './mongoDBDocumentService' ;
25
- import PartialExecutionCodeLensProvider from './partialExecutionCodeLensProvider' ;
26
26
import PlaygroundController from './playgroundController' ;
27
27
import PlaygroundResultProvider , {
28
28
PLAYGROUND_RESULT_SCHEME
@@ -37,6 +37,7 @@ const log = createLogger('editors controller');
37
37
* new editors and the data they need. It also manages active editors.
38
38
*/
39
39
export default class EditorsController {
40
+ _codeActionProvider : CodeActionProvider ;
40
41
_connectionController : ConnectionController ;
41
42
_playgroundController : PlaygroundController ;
42
43
_collectionDocumentsOperationsStore = new CollectionDocumentsOperationsStore ( ) ;
@@ -49,7 +50,6 @@ export default class EditorsController {
49
50
_telemetryService : TelemetryService ;
50
51
_playgroundResultViewProvider : PlaygroundResultProvider ;
51
52
_activeConnectionCodeLensProvider : ActiveConnectionCodeLensProvider ;
52
- _partialExecutionCodeLensProvider : PartialExecutionCodeLensProvider ;
53
53
_editDocumentCodeLensProvider : EditDocumentCodeLensProvider ;
54
54
_collectionDocumentsCodeLensProvider : CollectionDocumentsCodeLensProvider ;
55
55
@@ -61,7 +61,7 @@ export default class EditorsController {
61
61
telemetryService : TelemetryService ,
62
62
playgroundResultViewProvider : PlaygroundResultProvider ,
63
63
activeConnectionCodeLensProvider : ActiveConnectionCodeLensProvider ,
64
- partialExecutionCodeLensProvider : PartialExecutionCodeLensProvider ,
64
+ codeActionProvider : CodeActionProvider ,
65
65
editDocumentCodeLensProvider : EditDocumentCodeLensProvider
66
66
) {
67
67
log . info ( 'activating...' ) ;
@@ -90,10 +90,10 @@ export default class EditorsController {
90
90
) ;
91
91
this . _playgroundResultViewProvider = playgroundResultViewProvider ;
92
92
this . _activeConnectionCodeLensProvider = activeConnectionCodeLensProvider ;
93
- this . _partialExecutionCodeLensProvider = partialExecutionCodeLensProvider ;
94
93
this . _collectionDocumentsCodeLensProvider = new CollectionDocumentsCodeLensProvider (
95
94
this . _collectionDocumentsOperationsStore
96
95
) ;
96
+ this . _codeActionProvider = codeActionProvider ;
97
97
98
98
vscode . workspace . onDidCloseTextDocument ( ( e ) => {
99
99
const uriParams = new URLSearchParams ( e . uri . query ) ;
@@ -372,12 +372,6 @@ export default class EditorsController {
372
372
this . _activeConnectionCodeLensProvider
373
373
)
374
374
) ;
375
- this . _context . subscriptions . push (
376
- vscode . languages . registerCodeLensProvider (
377
- { language : 'mongodb' } ,
378
- this . _partialExecutionCodeLensProvider
379
- )
380
- ) ;
381
375
this . _context . subscriptions . push (
382
376
vscode . languages . registerCodeLensProvider (
383
377
{
@@ -396,6 +390,11 @@ export default class EditorsController {
396
390
this . _editDocumentCodeLensProvider
397
391
)
398
392
) ;
393
+ this . _context . subscriptions . push (
394
+ vscode . languages . registerCodeActionsProvider ( 'mongodb' , this . _codeActionProvider , {
395
+ providedCodeActionKinds : CodeActionProvider . providedCodeActionKinds
396
+ } )
397
+ ) ;
399
398
}
400
399
401
400
deactivate ( ) : void {
0 commit comments