Skip to content

Update API information for 2020.2.0a18 #1760

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

Merged
merged 13 commits into from
Jul 20, 2020
Merged

Update API information for 2020.2.0a18 #1760

merged 13 commits into from
Jul 20, 2020

Conversation

citizenmatt
Copy link
Member

This PR updates the API information to Unity 2020.2.0a18.

It should be that simple, but Unity have introduced a method that takes a List<string> and it's the first generic argument we've had to handle and it breaks everything. We were storing parameter and types as IClrTypeName, and using this interchangeably with C# types (e.g. when generating method declarations for code completion).

However, IClrTypeName can only hold, as the name suggests, CLR type names. This means open generics, rather than closed generics. And it does it in CLR format, not C# format. So it can hold System.Collections.Generic.List'1 (that should be a backtick, but markdown), but it can't hold System.Collections.Generic.List1[[System.String]]`. We also can't generate a method declaration from the open generic CLR type name, but need to convert it to a closed generic type first.

  • Update API information to Unity 2020.2.0a18. Closed generics are written in CLR form into the api.xml file and parsed into open generic + type parameter types when reading
  • API information is converted into IType using TypeFactory. This gives us proper type information, including closed generics
  • We create a lot of instances of types for "derives from" checks, completion + inspections, so the types are now cached per solution in a new class - KnownTypesCache
  • Added extra undocumented event functions

@citizenmatt citizenmatt added this to the Rider 2020.2 milestone Jul 17, 2020
@citizenmatt citizenmatt self-assigned this Jul 17, 2020
Introduces KnownTypesCache for types used in Unity APIs, which are checked frequently in things like DerivesFrom or method signature inspections
@citizenmatt citizenmatt merged commit 498c8bf into net202 Jul 20, 2020
@citizenmatt citizenmatt deleted the feature/api-update branch July 20, 2020 11:37
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.

2 participants