Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extensions cproj is being formated by the editor and stripped of NL #2055

Open
bruno-f-cruz opened this issue Nov 12, 2024 · 2 comments · May be fixed by #2180
Open

Extensions cproj is being formated by the editor and stripped of NL #2055

bruno-f-cruz opened this issue Nov 12, 2024 · 2 comments · May be fixed by #2180
Assignees
Labels
extensions.csproj Issue concerning local Bonsai extensions

Comments

@bruno-f-cruz
Copy link
Contributor

Not sure if it is something specific to my machine, but when Bonsai touches the .cproj extensions file, for instance, when a c# transform is added to the workflow with new dependencies, the .cproj file loses all NL characters. This is a bit annoying if one is doing version control on the file.

@bruno-f-cruz bruno-f-cruz changed the title Extensions cproj is being formated by the editor Extensions cproj is being formated by the editor and stripping NL Nov 12, 2024
@bruno-f-cruz bruno-f-cruz changed the title Extensions cproj is being formated by the editor and stripping NL Extensions cproj is being formated by the editor and stripped of NL Nov 12, 2024
@PathogenDavid PathogenDavid added the extensions.csproj Issue concerning local Bonsai extensions label Feb 7, 2025
@bruno-f-cruz
Copy link
Contributor Author

To reproduce:

1 - Open an empty workflow
2 - Add a ScalarBuffer. Save workflow.
3 - Add a CSharpTransform, and save the file in extensions. This will create a csproj and add the OpenCV reference to the file
4 - Repeat 2 and 3, but use CreateBinomial as the source operator which should add the Numerics namespace to csproj.
The file will now be in one line.

Image

PathogenDavid added a commit to NgrDavid/bonsai that referenced this issue Mar 10, 2025
@PathogenDavid PathogenDavid self-assigned this Mar 10, 2025
PathogenDavid added a commit to NgrDavid/bonsai that referenced this issue Mar 11, 2025
…ting for it

* Fix whitespace being stripped during automatic updates
* Fix fresh `Extensions.csproj` always being written with CRLF newlines
* Fix `ScriptExtensionsProjectMetadata` not actually being immutable as intended
* Fix adding redundant `ItemGroup` when all `PackageReference`s were removed but the group wasn't
* Added automatic exposing of assembly internals to the relevant test assembly
* Upgraded to C# 12 to get raw strings (our `global.json` already requires the .NET 8 SDK anyway)

Fixes bonsai-rx#2055
@PathogenDavid
Copy link
Member

PathogenDavid commented Mar 11, 2025

Thanks a lot for the repro BTW!

Sorry we assumed it was going to be a weird edge case, turns out it was just a dumb bug I introduced back in the first real PR I submitted for Bonsai 😅 #1753

Just submitted a PR to fix this (along with unit tests and some other fixes to issues I found along the way): #2180

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extensions.csproj Issue concerning local Bonsai extensions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants