Skip to content

Commit 8939c96

Browse files
committed
Fix Promise-related lint warnings
1 parent 646a241 commit 8939c96

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/extension.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,20 @@ import { generateSnippet } from './lib/textHelpers';
33

44
export function activate(context: ExtensionContext): void {
55
context.subscriptions.push(
6-
commands.registerTextEditorCommand('snippet-copy.copySnippet', async (editor) => {
7-
const snippet = await generateSnippet(editor.document, editor.selections, false);
8-
9-
void env.clipboard.writeText(snippet);
6+
commands.registerTextEditorCommand('snippet-copy.copySnippet', (editor) => {
7+
void generateSnippet(editor.document, editor.selections, false)
8+
.then((snippet) => {
9+
return env.clipboard.writeText(snippet);
10+
});
1011
})
1112
);
12-
context.subscriptions.push(
13-
commands.registerTextEditorCommand('snippet-copy.copySnippetAsMarkdownCodeBlock', async (editor) => {
14-
const snippet = await generateSnippet(editor.document, editor.selections, true);
1513

16-
void env.clipboard.writeText(snippet);
14+
context.subscriptions.push(
15+
commands.registerTextEditorCommand('snippet-copy.copySnippetAsMarkdownCodeBlock', (editor) => {
16+
void generateSnippet(editor.document, editor.selections, true)
17+
.then((snippet) => {
18+
return env.clipboard.writeText(snippet);
19+
});
1720
})
1821
);
1922
}

0 commit comments

Comments
 (0)