@@ -72,23 +72,6 @@ function detectConflictingExtension(extensionId: string): void {
7272 }
7373}
7474
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-
9275function sortedWorkspaceFolders ( ) : string [ ] {
9376 if ( _sortedWorkspaceFolders === void 0 ) {
9477 _sortedWorkspaceFolders = workspace . workspaceFolders
@@ -125,6 +108,26 @@ function getOuterMostWorkspaceFolder(folder: WorkspaceFolder): WorkspaceFolder {
125108 return folder ;
126109}
127110
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+
128131class DebugAdapterExecutableFactory implements vscode . DebugAdapterDescriptorFactory {
129132 createDebugAdapterDescriptor ( session : vscode . DebugSession , executable : vscode . DebugAdapterExecutable ) : vscode . ProviderResult < vscode . DebugAdapterDescriptor > {
130133 if ( session . workspaceFolder ) {
@@ -159,7 +162,7 @@ export function activate(context: ExtensionContext): void {
159162 // https://github.com/elixir-lsp/vscode-elixir-ls/issues/34
160163 detectConflictingExtension ( "sammkj.vscode-elixir-formatter" ) ;
161164
162- vscode . commands . registerCommand ( "extension.copyDebugInfo" , copyDebugInfo ) ;
165+ configureCopyDebugInfo ( context ) ;
163166 configureDebugger ( context ) ;
164167
165168 const command =
0 commit comments