Azure / Azure/bicep

If you republish a module then force restore, the source displayed is the previous one, but the document links are from the new sources

Open
#13,082 1 comment 0 reactions 0 assignees View on GitHub
devdiv P2 story: registry
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
![image](https://github.com/Azure/bicep/assets/6913354/ad062b4b-c8f7-4094-aa06-8a39d86cb163)

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:

![image](https://github.com/Azure/bicep/assets/6913354/4d653718-78d0-4b94-8734-b3bba5f9d509)

EXPECTED:

what you get after you reload vscode:
![image](https://github.com/Azure/bicep/assets/6913354/3933f266-4468-402d-ba6f-730fa2b7bcd8)

Contributor guide

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.