Azure / Azure/bicep

Code fix to extract a type / variable / func to a shared file with imports

Open
#14,768 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

If a user writes:
```bicep
type ContainerImage = {
registry: string
name: string
tag: string
}

param image ContainerImage
```

It would be nice to offer a code fix to generate the following:
```bicep
import { ContainerImage } from ''

param image ContainerImage
```

Where the user gets to pick `` (either pick existing or create new), and the contents include:

```bicep
@export()
type ContainerImage = {
registry: string
name: string
tag: string
}
```

Contributor guide

Open the contributing guide

Research direction

No files or tests are named. Start by locating the existing code-fix and import-handling entry points, then trace how a destination file is selected or created. Done means the example type can be extracted with @export(), an import is generated, and the original declaration is removed.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.