[elixir-core:11364] Format inspect output as valid elixir

2023-05-09 Thread Adam Kirk
I do this ALL the time, but heres a specific example: When I write a test, I do something like assert [] = Repo.all(Thing) it fails, I copy what the match shows into my test and modify it to what I need. except that it outputs stuff like: ``` __meta__: #Ecto.Schema.Metadata<:loaded,

Re: [elixir-core:11371] [Proposal] Enhancements in the API for optional dependencies

2023-05-09 Thread Yordis Prieto
Lately, personally speaking, the need for shipping a lot of testing-supporting functionalities is increasing; thus far, most popular packages in the ecosystem have some functionalities that are meant to be used only for testing (Plug, Broadway, Oban, ...). It is not about dependency issues,

Re: [elixir-core:11364] Format inspect output as valid elixir

2023-05-09 Thread José Valim
There is a "structs: false" option but I am not sure if that is supported when diffing. But also keep in mind there are structures that represent memory data (such as PIDs and REFs) and those can never really be copy and pasted. And sometimes, like above, it shows in a special style because it is

Re: [elixir-core:11368] Format inspect output as valid elixir

2023-05-09 Thread Adam Kirk
Yeah, I was afraid it might be a poor cost/benefit ratio. I guess I posted here in case a lot of other people felt this pain as well. On Tuesday, May 9, 2023 at 10:03:36 AM UTC-6 José Valim wrote: > Yeah, I see. One solution would be to introduce /* ... */ style comments > (not exactly with

Re: [elixir-core:11369] Format inspect output as valid elixir

2023-05-09 Thread Billy Lanchantin
I encounter this often. Here's a small workaround I use. I copy/paste the struct into a new VSCode tab and do the following find/replace Search: `.+#.+\n` Replace: `` (aka nothing) Then you can format. E.g. this turns: ``` %User{ __meta__: #Ecto.Schema.Metadata<:loaded, "users">, id: 123,

Re: [elixir-core:11366] Format inspect output as valid elixir

2023-05-09 Thread Adam Kirk
Ok, I guess I just wish it was `mix format` friendly because then its much much easier to remove it On Tuesday, May 9, 2023 at 9:51:54 AM UTC-6 José Valim wrote: > There is a "structs: false" option but I am not sure if that is supported > when diffing. > > But also keep in mind there are

Re: [elixir-core:11366] Format inspect output as valid elixir

2023-05-09 Thread José Valim
Yeah, I see. One solution would be to introduce /* ... */ style comments (not exactly with this syntax) but it sounds like a large change for small benefits. Can anyone think of other approaches? On Tue, May 9, 2023 at 5:57 PM Adam Kirk wrote: > Ok, I guess I just wish it was `mix format`

Re: [elixir-core:11370] Format inspect output as valid elixir

2023-05-09 Thread Adam Kirk
Thats smart. I think I'll try making an alfred workflow to transform it in my clipboard On Tuesday, May 9, 2023 at 10:06:46 AM UTC-6 william.l...@cargosense.com wrote: > I encounter this often. Here's a small workaround I use. > > I copy/paste the struct into a new VSCode tab and do the