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';
33
44export 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}
You can’t perform that action at this time.
0 commit comments