Skip to content

Conversation

@deepfuriya
Copy link
Contributor

Summary

Filters out Fn::ForEach::* resources from autocomplete suggestions when inside !Ref and !GetAtt intrinsic functions. These loop construct resources are not valid references and should not appear as completion options.

Changes

  • IntrinsicFunctionArgumentCompletionProvider.ts:
    • getResourceCompletions(): Skip resources with names starting with Fn::ForEach::
    • getGetAttResourceCompletions(): Skip resources with names starting with Fn::ForEach::

Testing

  • Added unit tests in IntrinsicFunctionArgumentCompletionProvider.Ref.test.ts
  • Added unit tests in IntrinsicFunctionArgumentCompletionProvider.GetAtt.test.ts
  • Added e2e test in Completion.test.ts for YAML cross-reference completions

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@deepfuriya deepfuriya requested a review from a team as a code owner December 29, 2025 20:37
@deepfuriya deepfuriya force-pushed the fix/forEach-refs branch 3 times, most recently from 780c982 to 7cca2f2 Compare December 30, 2025 18:38
@deepfuriya deepfuriya force-pushed the fix/forEach-refs branch 2 times, most recently from 437059d to 14528b3 Compare January 6, 2026 16:25
@deepfuriya deepfuriya merged commit 04291a4 into main Jan 7, 2026
16 checks passed
@deepfuriya deepfuriya deleted the fix/forEach-refs branch January 7, 2026 15:25
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.

3 participants