microsoft / microsoft/typespec

[http-client-csharp] `SystemObjectTypeProvider` looks unnecessary

Open
#11,261 1 comment 1 reaction 1 assignee Claimed by @live1206 View on GitHub
emitter:client:csharp feature
Dominant language
Java
Stars
5.9k
Forks
394
Avg merge
1d 23h
Merged PRs (30d)
104

Description

We introduced [SystemObjectTypeProvider](https://github.com/microsoft/typespec/blob/ca92ba3d1f05317a04afb1c2ca8dcdcaa15527f1/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/SystemObjectTypeProvider.cs#L16) to represent any type written in custom code.
But NamedSymbolTypeProvider is doing the same thing, do we really need both?

Also in the BaseType resolution logic in `ModelProvider`, we have 3 different methods:
`BuildBaseType` (BaseType), `BuildBaseTypeProvider` (BaseTypeProvider) and `BuildBaseModelProvider` (BaseModelProvider)
they do not really agree with each other.
`BuildBaseTypeProvider` builds another instance (instantiating `SystemObjectTypeProvider`) instead of just returning whatever returned by BaseModelProvider.

I think we should figure out and make them consistent.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.