1+ import { commands } from 'vscode'
12import { RegisteredCommands } from '../../commands/external'
23import { InternalCommands } from '../../commands/internal'
34import { showSetupOrExecuteCommand } from '../../commands/util'
45import { Setup } from '../../setup'
56import { Context , getDvcRootFromContext } from '../../vscode/context'
67import { WorkspacePlots } from '../workspace'
8+ import { WorkspacePipeline } from '../../pipeline/workspace'
79
810export const registerPlotsCommands = (
911 plots : WorkspacePlots ,
1012 internalCommands : InternalCommands ,
11- setup : Setup
13+ setup : Setup ,
14+ pipelines : WorkspacePipeline
1215) => {
16+ commands . registerCommand ( RegisteredCommands . ADD_PLOT , ( context : Context ) =>
17+ plots . addPlot ( pipelines , getDvcRootFromContext ( context ) )
18+ )
19+
1320 internalCommands . registerExternalCommand (
1421 RegisteredCommands . PLOTS_SHOW ,
1522 showSetupOrExecuteCommand ( setup , context =>
@@ -27,11 +34,6 @@ export const registerPlotsCommands = (
2734 ( context : Context ) => plots . refresh ( getDvcRootFromContext ( context ) )
2835 )
2936
30- internalCommands . registerExternalCommand (
31- RegisteredCommands . PLOTS_CUSTOM_ADD ,
32- ( context : Context ) => plots . addCustomPlot ( getDvcRootFromContext ( context ) )
33- )
34-
3537 internalCommands . registerExternalCommand (
3638 RegisteredCommands . PLOTS_CUSTOM_REMOVE ,
3739 ( context : Context ) =>
0 commit comments