If you republish a module then force restore, the source displayed is the previous one, but the document links are from the new sources
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 79
Description
1) Create two files:
main.bicep:
```bicep
module module1 './module1.bicep' = {
name: 'module1'
}
module module1b './module1.bicep' = {
name: 'module1b'
}
```
module1.bicep: (empty)
```bicep
```
2) publish:
bicep publish main.bicep --target br:.azurecr.io/bug:v1--with-source
3) create new bicep file "test.bicep"
```bicep
module m1 'br:/bug:v1' = {
name: 'm1'
}
```
4) Press F12 on "bug:v1" and click to see the Bicep source

5) change main.bicep to look like this:
main.bicep:
```bicep
module module1 './a/../module1.bicep' = {
name: 'module1'
}
// some extra lines are intended to be here
// some extra lines are intended to be here
module module1b '.a/../module1.bicep' = {
name: 'module1b'
}
```
6) republish with --force
7) Force restore modules in test.bicep
8) Press F12 on "bug:v1"
!) it shows the old source, and notice the links don't line up with the source:

EXPECTED:
what you get after you reload vscode:

Contributor guide
Research direction
Reproduce the issue with main.bicep and test.bicep using bicep publish, --force, force restore, and F12 in VS Code. Start by tracing the source-display and document-link behavior during module restore. Done means the restored source and its document links match the republished module without requiring a VS Code reload.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, vscode
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100