Skip to content

Commit

Permalink
Merge pull request #18 from chickensoft-games/chore/upgrade-introspec…
Browse files Browse the repository at this point in the history
…tion

chore: upgrade introspection
  • Loading branch information
jolexxa authored Oct 23, 2024
2 parents 9a2e95c + 7d6bc0f commit 68c490d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
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

0 comments on commit 68c490d

Please sign in to comment.