Convert meta model generator to STJ#72
Conversation
The RegenerateTypes MSBuild target calls Restore/Build on the MetaModelGenerator tool project. When invoked from dotnet pack src, the outer TargetFramework=netstandard2.0 is inherited, causing NuGet to validate the tool's packages against netstandard2.0 and fail on Fabulous.AST (which only supports net8.0+). Pass RemoveProperties="TargetFramework" so the tool project restores and builds against its own declared net9.0 TFM. 🤖 Generated with eca
0bb1f1e to
70498a0
Compare
TheAngryByrd
left a comment
There was a problem hiding this comment.
Nice! Glad this was an easy convertion.
There was a problem hiding this comment.
Pull request overview
Migrates the MetaModelGenerator tool off Newtonsoft.Json onto System.Text.Json while updating the repo/tooling to use .NET 10 and keeping generated output formatting stable.
Changes:
- Replace
Newtonsoft.Jsondeserialization withSystem.Text.Json(including new STJ converters for metaModel.json quirks). - Update tool/test TFMs to
net10.0and bumpglobal.json+ CI workflows to .NET SDK 10. - Stabilize generated formatting by passing an explicit Fantomas
FormatConfig, and fixdotnet pack srcrestore/build TFM inheritance viaRemoveProperties="TargetFramework".
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/MetaModelGenerator/Program.fs | Switch meta model deserialization call to System.Text.Json. |
| tools/MetaModelGenerator/MetaModelGenerator.fsproj | Remove Newtonsoft.Json + OptionConverter.fs, retarget tool to net10.0. |
| tools/MetaModelGenerator/MetaModel.fs | Add STJ converters/options used to parse metaModel.json. |
| tools/MetaModelGenerator/GenerateTypes.fs | Pass explicit Fantomas FormatConfig for stable generated formatting. |
| tools/MetaModelGenerator/GenerateClientServer.fs | Pass explicit Fantomas FormatConfig for stable generated formatting. |
| tests/Ionide.LanguageServerProtocol.Tests.fsproj | Update test TFMs to include net10.0. |
| src/Types.cg.fs | Formatting-only changes in generated types output. |
| src/Ionide.LanguageServerProtocol.fsproj | Ensure generator restore/build uses its own TFM via RemoveProperties="TargetFramework". |
| src/ClientServer.cg.fs | Formatting-only changes in generated client/server output. |
| global.json | Bump pinned .NET SDK to 10.0.100. |
| .github/workflows/publish.yml | Update CI to install .NET 10. |
| .github/workflows/build.yml | Update CI to install .NET 10. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I'll let you address copilots review, just lemme know if it's junk or worth addressing then I'll merge it. |
…is shared between GenerateTypes.fs and GenerateClientServer.fs
8ce4f92 to
27c7ce6
Compare
…n some of Converters
40fbb9f to
0e41cfb
Compare
There were good, actually, at least most of them. Addressed in the PR |
Summary
Newtonsoft.JsonwithSystem.Text.Jsonin theMetaModelGeneratortool (for parsingmetaModel.json); generated output still references Newtonsoft.Json unchangedNewtonsoft.Jsonpackage reference and../../src/OptionConverter.fsfrom the tool projectMetaModelGeneratortonet10.0and updateglobal.json+ CI workflows accordinglyFormatConfigtoFormatOakAsyncmatching.editorconfig, keeping generated output stable across runsNU1202duringdotnet pack srcby addingRemoveProperties="TargetFramework"to the tool's MSBuild Restore/Build calls, so the tool's own TFM is used instead of inheritingnetstandard2.0from the outer buildNotable:
EnumerationEntry.Valueneeds aStringOrNumberAsStringConverterbecause integer enum values inmetaModel.jsonare JSON numbers — NSJ coerced them silently, STJ does not.🤖 Generated with eca