Skip to content

Commit

Permalink
Enable focusing on typed constant on caret hover
Browse files Browse the repository at this point in the history
  • Loading branch information
Rekkonnect committed Aug 6, 2024
1 parent 32c4b61 commit 635f574
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Syndiesis/Core/DisplayAnalysis/SyntaxObjectInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ private static LinePositionSpan LineSpanOrDefault(SyntaxTree? tree, TextSpan spa
case AttributeData attribute:
return attribute.GetAttributeApplicationSyntax()?.SyntaxTree;

case AttributeDataViewModel attributeModel:
return GetSyntaxTree(attributeModel.NamedArguments);

case AttributeDataViewModel.LinkedAttributeArgument attributeArgument:
return GetSyntaxTree(attributeArgument.ArgumentSyntax);

// Operation
case IOperation operation:
return operation.Syntax.SyntaxTree;
Expand Down Expand Up @@ -178,6 +184,12 @@ private static TextSpan GetSpan(object x)
return attribute.ApplicationSyntaxReference
?.Span ?? InvalidTextSpan;

case AttributeDataViewModel attributeModel:
return GetSpan(attributeModel.NamedArguments);

case AttributeDataViewModel.LinkedAttributeArgument attributeArgument:
return GetSpan(attributeArgument.ArgumentSyntax);

// Operation
case IOperation operation:
return operation.Syntax.Span;
Expand Down Expand Up @@ -244,6 +256,12 @@ private static TextSpan GetFullSpan(object x)
return attribute.GetAttributeApplicationSyntax()
?.FullSpan ?? InvalidTextSpan;

case AttributeDataViewModel attributeModel:
return GetFullSpan(attributeModel.NamedArguments);

case AttributeDataViewModel.LinkedAttributeArgument attributeArgument:
return GetFullSpan(attributeArgument.ArgumentSyntax);

// Operation
case IOperation operation:
return operation.Syntax.FullSpan;
Expand Down

0 comments on commit 635f574

Please sign in to comment.