forked from microsoft/vscode-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatascience.ts
More file actions
37 lines (31 loc) · 1.44 KB
/
datascience.ts
File metadata and controls
37 lines (31 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
import { inject, injectable } from 'inversify';
import { IApplicationShell, ICommandManager } from '../common/application/types';
import { IDisposableRegistry } from '../common/types';
import { IServiceContainer } from '../ioc/types';
import { Commands } from './constants';
import { IDataScience } from './types';
@injectable()
export class DataScience implements IDataScience {
private readonly appShell: IApplicationShell;
private readonly commandManager: ICommandManager;
private readonly disposableRegistry: IDisposableRegistry;
constructor(@inject(IServiceContainer) private serviceContainer: IServiceContainer)
{
this.appShell = this.serviceContainer.get<IApplicationShell>(IApplicationShell);
this.commandManager = this.serviceContainer.get<ICommandManager>(ICommandManager);
this.disposableRegistry = this.serviceContainer.get<IDisposableRegistry>(IDisposableRegistry);
}
public async activate(): Promise<void> {
this.registerCommands();
}
public async executeDataScience(): Promise<void> {
await this.appShell.showInformationMessage('Hello Data Science');
}
private registerCommands(): void {
const disposable = this.commandManager.registerCommand(Commands.DataScience, this.executeDataScience, this);
this.disposableRegistry.push(disposable);
}
}