Skip to content

Commit 7b03b18

Browse files
committed
context.subscriptionsを利用
1 parent 96b125e commit 7b03b18

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/extension.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
1-
import { commands, window /* , ExtensionContext */} from 'vscode';
1+
import { commands, ExtensionContext, window } from 'vscode';
22
import * as nls from 'vscode-nls';
33
import { compose } from './commands/compose';
44
import { deleteItem } from './commands/deleteItem';
55
import { editTags } from './commands/editTags';
66
import { makePublic } from './commands/makePublic';
7+
import { openItem } from './commands/openItem';
78
import { openItemExternal } from './commands/openItemExternal';
89
import { QiitaItemProvider } from './explorer/qiitaItems';
910
import './polyfills';
1011

1112
nls.config(process.env.VSCODE_NLS_CONFIG as nls.Options)();
1213

13-
export function activate (/*context: ExtensionContext */) {
14+
export function activate (context: ExtensionContext) {
15+
console.log(context);
1416
window.registerTreeDataProvider('qiitaItems', new QiitaItemProvider());
1517

16-
commands.registerCommand('qiita.openItem', () => undefined);
17-
commands.registerCommand('qiita.editTags', editTags);
18-
commands.registerCommand('qiita.makePublic', makePublic);
19-
commands.registerCommand('qiita.compose', compose);
20-
commands.registerCommand('qiita.openItemExternal', openItemExternal);
21-
commands.registerCommand('qiita.deleteItem', deleteItem);
18+
context.subscriptions.push(
19+
commands.registerCommand('qiita.openItem', openItem(context.storagePath)),
20+
commands.registerCommand('qiita.editTags', editTags),
21+
commands.registerCommand('qiita.makePublic', makePublic),
22+
commands.registerCommand('qiita.compose', compose),
23+
commands.registerCommand('qiita.openItemExternal', openItemExternal),
24+
commands.registerCommand('qiita.deleteItem', deleteItem),
25+
);
2226
}
2327

2428
export function deactivate () {

0 commit comments

Comments
 (0)