Skip to content

Commit

Permalink
fix: template warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
fannheyward committed Jan 10, 2024
1 parent 598d70d commit d055002
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions template/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { commands, CompleteResult, ExtensionContext, listManager, sources, windo
import DemoList from './lists';

export async function activate(context: ExtensionContext): Promise<void> {
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
Expand All @@ -23,7 +23,7 @@ export async function activate(context: ExtensionContext): Promise<void> {
['n'],
'[keymap-title]-keymap',
async () => {
window.showMessage(`registerKeymap`);
window.showInformationMessage('registerKeymap');
},
{ sync: false }
),
Expand All @@ -32,7 +32,7 @@ export async function activate(context: ExtensionContext): Promise<void> {
event: 'InsertLeave',
request: true,
callback: () => {
window.showMessage(`registerAutocmd on InsertLeave`);
window.showInformationMessage('registerAutocmd on InsertLeave');
},
})
);
Expand Down
8 changes: 4 additions & 4 deletions template/src/lists.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
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';
public readonly description = 'CocList for [title]';
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}`);
});
}

Expand Down

0 comments on commit d055002

Please sign in to comment.