Skip to content

Conversation

@SteveL-MSFT
Copy link
Member

PR Summary

User functions namespace can have underscores prefix as generated from bicep. This fixes the grammar to allow for underscores in the namespace but not the function name.

PR Context

Fix #1271

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for user function namespaces to have underscore prefixes, addressing issue #1271. This change accommodates bicep-generated namespaces that may include underscore prefixes.

Key Changes:

  • Modified the DSC expression grammar to allow underscores in function namespace identifiers
  • Added test coverage for namespace with underscore prefix (__bicep.myFunction)
  • Updated existing PowerShell test to use underscore-prefixed namespace

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
grammars/tree-sitter-dscexpression/grammar.js Updated functionName regex to allow underscores in namespace while keeping function names alphanumeric only
grammars/tree-sitter-dscexpression/test/corpus/valid_expressions.txt Added test case for namespace with double underscore prefix
dsc/tests/dsc_user_functions.tests.ps1 Updated test case to use __MyFunction namespace demonstrating the new functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Nov 18, 2025
Merged via the queue into PowerShell:main with commit da8f514 Nov 18, 2025
25 checks passed
@SteveL-MSFT SteveL-MSFT deleted the bicep-user-function branch November 18, 2025 21:45
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.

Encountering error invoking a user defined function in bicep config file

3 participants