diff --git a/README.md b/README.md index 5f8ae59..d557625 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ coc-test is created. cd /Users/fannheyward/src/coc-test && npm i -then "set runtimepath^=/Users/fannheyward/src/coc-test" in vimrc/init.vim, and you will see "[coc.nvim] coc-test works!" in vim messages. +then "set runtimepath^=/Users/fannheyward/src/coc-test" in vimrc/init.vim, and you will see "[coc.nvim] coc-test works!" notification. ``` 1. `:CocCommand coc-test.Command` for command diff --git a/template/src/index.ts b/template/src/index.ts index 267c3ff..977ce94 100644 --- a/template/src/index.ts +++ b/template/src/index.ts @@ -2,14 +2,14 @@ import { commands, CompleteResult, ExtensionContext, listManager, sources, windo import DemoList from './lists'; export async function activate(context: ExtensionContext): Promise { - window.showMessage(`[title] works!`); + window.showInformationMessage('[title] works!'); context.subscriptions.push( commands.registerCommand('[title].Command', async () => { - window.showMessage(`[title] Commands works!`); + window.showInformationMessage('[title] Commands works!'); }), - listManager.registerList(new DemoList(workspace.nvim)), + listManager.registerList(new DemoList()), sources.createSource({ name: '[title] completion source', // unique id @@ -23,7 +23,7 @@ export async function activate(context: ExtensionContext): Promise { ['n'], '[keymap-title]-keymap', async () => { - window.showMessage(`registerKeymap`); + window.showInformationMessage('registerKeymap'); }, { sync: false } ), @@ -32,7 +32,7 @@ export async function activate(context: ExtensionContext): Promise { event: 'InsertLeave', request: true, callback: () => { - window.showMessage(`registerAutocmd on InsertLeave`); + window.showInformationMessage('registerAutocmd on InsertLeave'); }, }) ); diff --git a/template/src/lists.ts b/template/src/lists.ts index 85176a8..a3dffc7 100644 --- a/template/src/lists.ts +++ b/template/src/lists.ts @@ -1,4 +1,4 @@ -import { BasicList, ListAction, ListContext, ListItem, Neovim, window } from 'coc.nvim'; +import { BasicList, ListAction, ListContext, ListItem, window } from 'coc.nvim'; export default class DemoList extends BasicList { public readonly name = 'demo_list'; @@ -6,11 +6,11 @@ export default class DemoList extends BasicList { public readonly defaultAction = 'open'; public actions: ListAction[] = []; - constructor(nvim: Neovim) { - super(nvim); + constructor() { + super(); this.addAction('open', (item: ListItem) => { - window.showMessage(`${item.label}, ${item.data.name}`); + window.showInformationMessage(`${item.label}, ${item.data.name}`); }); }