Open jikuja opened 3 years ago
Great suggestion - I also usually try to avoid overlap with built-ins:
For what it's worth, IntelliSense today only offers the fully qualified az.environment()
function completion when there is an environment
symbol declared.
This problem should only occur if the environment
symbol is added after some calls to the environment()
function have been made in the file, but it does present at the places where the function is called, so a linter would definitely help.
I think we should add some logic to suggest some options for fully qualifying the function. Theoretically, the worst case is n namespaces containing a function with the same name, but the average case is 1. Producing a code fix per namespace would make it easier for the user to correct the issue as well.
Separately, I think we need to update the "Rename Symbol" logic to automatically fully qualify function calls that will break after the rename completes.
Bicep should warn if parameter or variable overrides built-in function: e.g. adding parameter named environment.
Getting error when trying to access the function is too late even modern tools offers good refactoring for parameter and variable naming.