Skip to content

Convert meta model generator to STJ#72

Merged
TheAngryByrd merged 7 commits into
ionide:mainfrom
razzmatazz:convert-meta-model-generator-to-stj
May 29, 2026
Merged

Convert meta model generator to STJ#72
TheAngryByrd merged 7 commits into
ionide:mainfrom
razzmatazz:convert-meta-model-generator-to-stj

Conversation

@razzmatazz
Copy link
Copy Markdown
Contributor

@razzmatazz razzmatazz commented May 28, 2026

Summary

  • Replace Newtonsoft.Json with System.Text.Json in the MetaModelGenerator tool (for parsing metaModel.json); generated output still references Newtonsoft.Json unchanged
  • Drop the Newtonsoft.Json package reference and ../../src/OptionConverter.fs from the tool project
  • Switch MetaModelGenerator to net10.0 and update global.json + CI workflows accordingly
  • Pass an explicit FormatConfig to FormatOakAsync matching .editorconfig, keeping generated output stable across runs
  • Fix NU1202 during dotnet pack src by adding RemoveProperties="TargetFramework" to the tool's MSBuild Restore/Build calls, so the tool's own TFM is used instead of inheriting netstandard2.0 from the outer build

Notable: EnumerationEntry.Value needs a StringOrNumberAsStringConverter because integer enum values in metaModel.json are JSON numbers — NSJ coerced them silently, STJ does not.

🤖 Generated with eca

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
@razzmatazz razzmatazz force-pushed the convert-meta-model-generator-to-stj branch from 0bb1f1e to 70498a0 Compare May 28, 2026 07:17
@TheAngryByrd TheAngryByrd requested a review from Copilot May 28, 2026 18:24
Copy link
Copy Markdown
Member

@TheAngryByrd TheAngryByrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Glad this was an easy convertion.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Json deserialization with System.Text.Json (including new STJ converters for metaModel.json quirks).
  • Update tool/test TFMs to net10.0 and bump global.json + CI workflows to .NET SDK 10.
  • Stabilize generated formatting by passing an explicit Fantomas FormatConfig, and fix dotnet pack src restore/build TFM inheritance via RemoveProperties="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.

Comment thread tools/MetaModelGenerator/MetaModel.fs Outdated
Comment thread tools/MetaModelGenerator/MetaModel.fs Outdated
Comment thread tools/MetaModelGenerator/MetaModel.fs Outdated
Comment thread tools/MetaModelGenerator/MetaModel.fs Outdated
Comment thread tools/MetaModelGenerator/GenerateTypes.fs Outdated
@TheAngryByrd
Copy link
Copy Markdown
Member

I'll let you address copilots review, just lemme know if it's junk or worth addressing then I'll merge it.

@razzmatazz razzmatazz force-pushed the convert-meta-model-generator-to-stj branch from 8ce4f92 to 27c7ce6 Compare May 29, 2026 06:10
@razzmatazz razzmatazz force-pushed the convert-meta-model-generator-to-stj branch from 40fbb9f to 0e41cfb Compare May 29, 2026 06:20
@razzmatazz
Copy link
Copy Markdown
Contributor Author

I'll let you address copilots review, just lemme know if it's junk or worth addressing then I'll merge it.

There were good, actually, at least most of them. Addressed in the PR

@TheAngryByrd TheAngryByrd merged commit d639298 into ionide:main May 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants