@@ -72,23 +72,6 @@ function detectConflictingExtension(extensionId: string): void {
72
72
}
73
73
}
74
74
75
- function copyDebugInfo ( ) : void {
76
- const elixirVersion = execSync ( `elixir --version` ) ;
77
- const extension = vscode . extensions . getExtension ( "jakebecker.elixir-ls" ) ;
78
- if ( ! extension ) {
79
- return ;
80
- }
81
-
82
- const message = `
83
- * Elixir & Erlang versions (elixir --version): ${ elixirVersion }
84
- * VSCode ElixirLS version: ${ extension . packageJSON . version }
85
- * Operating System Version: ${ os . platform ( ) } ${ os . release ( ) }
86
- ` ;
87
-
88
- vscode . window . showInformationMessage ( `Copied to clipboard: ${ message } ` ) ;
89
- vscode . env . clipboard . writeText ( message ) ;
90
- }
91
-
92
75
function sortedWorkspaceFolders ( ) : string [ ] {
93
76
if ( _sortedWorkspaceFolders === void 0 ) {
94
77
_sortedWorkspaceFolders = workspace . workspaceFolders
@@ -125,6 +108,26 @@ function getOuterMostWorkspaceFolder(folder: WorkspaceFolder): WorkspaceFolder {
125
108
return folder ;
126
109
}
127
110
111
+ function configureCopyDebugInfo ( context : ExtensionContext ) {
112
+ const disposable = vscode . commands . registerCommand ( "extension.copyDebugInfo" , ( ) => {
113
+ const elixirVersion = execSync ( `elixir --version` ) ;
114
+ const extension = vscode . extensions . getExtension ( "jakebecker.elixir-ls" ) ;
115
+ if ( ! extension ) {
116
+ return ;
117
+ }
118
+
119
+ const message = `
120
+ * Elixir & Erlang versions (elixir --version): ${ elixirVersion }
121
+ * VSCode ElixirLS version: ${ extension . packageJSON . version }
122
+ * Operating System Version: ${ os . platform ( ) } ${ os . release ( ) }
123
+ ` ;
124
+
125
+ vscode . window . showInformationMessage ( `Copied to clipboard: ${ message } ` ) ;
126
+ vscode . env . clipboard . writeText ( message ) ;
127
+ } ) ;
128
+ context . subscriptions . push ( disposable ) ;
129
+ }
130
+
128
131
class DebugAdapterExecutableFactory implements vscode . DebugAdapterDescriptorFactory {
129
132
createDebugAdapterDescriptor ( session : vscode . DebugSession , executable : vscode . DebugAdapterExecutable ) : vscode . ProviderResult < vscode . DebugAdapterDescriptor > {
130
133
if ( session . workspaceFolder ) {
@@ -159,7 +162,7 @@ export function activate(context: ExtensionContext): void {
159
162
// https://github.com/elixir-lsp/vscode-elixir-ls/issues/34
160
163
detectConflictingExtension ( "sammkj.vscode-elixir-formatter" ) ;
161
164
162
- vscode . commands . registerCommand ( "extension.copyDebugInfo" , copyDebugInfo ) ;
165
+ configureCopyDebugInfo ( context ) ;
163
166
configureDebugger ( context ) ;
164
167
165
168
const command =
0 commit comments