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

chore: upgrade introspection #18

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<PackageReference Include="Chickensoft.GoDotTest" Version="1.5.3" />
<PackageReference Include="Chickensoft.GodotTestDriver" Version="3.0.0" />
<PackageReference Include="Chickensoft.GodotNodeInterfaces" Version="2.2.4" />
<PackageReference Include="Chickensoft.Introspection" Version="1.2.0" />
<PackageReference Include="Chickensoft.Introspection.Generator" Version="1.2.0" PrivateAssets="all" OutputItemType="analyzer" />
<PackageReference Include="Chickensoft.Introspection" Version="2.0.0" />
<PackageReference Include="Chickensoft.Introspection.Generator" Version="2.0.0" PrivateAssets="all" OutputItemType="analyzer" />
</ItemGroup>
</Project>
12 changes: 6 additions & 6 deletions Chickensoft.AutoInject.Tests/src/auto_connect/AutoConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ IAutoConnect autoConnect
// type.
_checker.Value = fakeNode;

property.GenericType.GenericTypeGetter(_checker);
property.TypeNode.GenericTypeGetter(_checker);

var satisfiesFakeType = _checker.Result;

if (!satisfiesFakeType) {
e = new InvalidOperationException(
$"Found a faked node at '{path}' of type " +
$"'{fakeNode.GetType().Name}' that is not the expected type " +
$"'{property.GenericType.ClosedType}' for member " +
$"'{property.TypeNode.ClosedType}' for member " +
$"'{property.Name}' on '{node.Name}'."
);
GD.PushError(e.Message);
Expand All @@ -77,7 +77,7 @@ IAutoConnect autoConnect
e = new InvalidOperationException(
$"AutoConnect: Node at '{path}' does not exist in either the real " +
$"or fake subtree for '{node.Name}' member '{property.Name}' of " +
$"type '{property.GenericType.ClosedType}'."
$"type '{property.TypeNode.ClosedType}'."
);
GD.PushError(e.Message);
throw e;
Expand All @@ -86,7 +86,7 @@ IAutoConnect autoConnect
// see if the unchecked node satisfies the expected type of node from the
// property type
_checker.Value = child;
property.GenericType.GenericTypeGetter(_checker);
property.TypeNode.GenericTypeGetter(_checker);
var originalNodeSatisfiesType = _checker.Result;

if (originalNodeSatisfiesType) {
Expand All @@ -106,7 +106,7 @@ IAutoConnect autoConnect
var adaptedChild = GodotInterfaces.AdaptNode(child);
_checker.Value = adaptedChild;

property.GenericType.GenericTypeGetter(_checker);
property.TypeNode.GenericTypeGetter(_checker);
var adaptedChildSatisfiesType = _checker.Result;

if (adaptedChildSatisfiesType) {
Expand All @@ -119,7 +119,7 @@ IAutoConnect autoConnect
// Tell user we can't connect the node to the property.
e = new InvalidOperationException(
$"Node at '{path}' of type '{child.GetType().Name}' does not " +
$"satisfy the expected type '{property.GenericType.ClosedType}' for " +
$"satisfy the expected type '{property.TypeNode.ClosedType}' for " +
$"member '{property.Name}' on '{node.Name}'."
);
GD.PushError(e.Message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,13 @@ void onProviderInitialized(IBaseProvider provider) {

// Use the generated introspection metadata to determine if
// we have found the correct provider for the dependency.
property.GenericType.GenericTypeGetter(Validator);
property.TypeNode.GenericTypeGetter(Validator);
var isCorrectProvider = Validator.Result;

if (isCorrectProvider) {
// Add the provider to our internal dependency table.
state.Dependencies.Add(
property.GenericType.ClosedType, provider
property.TypeNode.ClosedType, provider
);

// Mark this dependency to be removed from the list of dependencies
Expand Down
Loading