Azure / Azure/bicep

Completions for the `getSecret` method are shown in context where they are not valid

Open
#2,630 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 2h
Merged PRs (30d)
79

Description

**Bicep version**
Latest in `main`

**Describe the bug**
Completions for the `getSecret` method are shown in context where they are not valid.

**To Reproduce**
Steps to reproduce the behavior:
![image](https://user-images.githubusercontent.com/22460039/117868950-0de1e280-b24f-11eb-83da-deaefb0251f6.png)

After committing the completion, you get the following error immediately:
![image](https://user-images.githubusercontent.com/22460039/117869084-34078280-b24f-11eb-8403-4421bbcb6f5c.png)

**Additional context**
I think we should account for function placement flags when offering this completion so it doesn't show up in invalid contexts. However, I think it's ok to offer this completion on module params that aren't tagged as secure. It's possible the user is refactoring and just hasn't tagged them as secure.

Contributor guide

Open the contributing guide

Research direction

Reproduce the invalid getSecret completion in the latest Bicep main build, then locate the completion logic that offers this method and inspect how function placement flags are handled. Done means getSecret is not offered in invalid contexts while remaining available for permitted module parameters, including those without a secure tag.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.