File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -3,17 +3,20 @@ import { generateSnippet } from './lib/textHelpers';
3
3
4
4
export function activate ( context : ExtensionContext ) : void {
5
5
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
+ } ) ;
10
11
} )
11
12
) ;
12
- context . subscriptions . push (
13
- commands . registerTextEditorCommand ( 'snippet-copy.copySnippetAsMarkdownCodeBlock' , async ( editor ) => {
14
- const snippet = await generateSnippet ( editor . document , editor . selections , true ) ;
15
13
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
+ } ) ;
17
20
} )
18
21
) ;
19
22
}
You can’t perform that action at this time.
0 commit comments