Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix go to def for template spec modules #14871

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

shenglol
Copy link
Contributor

@shenglol shenglol commented Aug 22, 2024

The "Go to Definition" feature for template specs in VS Code is currently broken. When used, it opens the template spec JSON file in an editable state, though it should be read-only. This action then triggers the documentDidOpen event for the JSON file, which leads to a compilation update for the template spec module. As a result, the Bicep compiler mistakenly interprets the template spec JSON file as an ARM template, causing an The reference ARM template has errors message. This PR aims to fix that issue.

The problem was initially identified during the investigation of issue #14660. However, this PR might not fully resolve the issue, as according to the customer, the The reference ARM template has errors message can still appear randomly, even when "Go to Definition" is not used.

Microsoft Reviewers: Open in CodeFlow

@shenglol shenglol enabled auto-merge (squash) August 22, 2024 01:15
Copy link
Contributor

github-actions bot commented Aug 22, 2024

Test this change out locally with the following install scripts (Action run 10500185948)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 10500185948
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 10500185948"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 10500185948
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 10500185948"

Copy link
Contributor

Dotnet Test Results

    72 files   -     36      72 suites   - 36   23m 36s ⏱️ - 10m 3s
11 044 tests  -     19  11 044 ✅  -     19  0 💤 ±0  0 ❌ ±0 
25 864 runs   - 12 925  25 864 ✅  - 12 925  0 💤 ±0  0 ❌ ±0 

Results for commit 75113a9. ± Comparison against base commit e42fbe6.

@shenglol shenglol merged commit 68f9bca into main Aug 22, 2024
46 of 47 checks passed
@shenglol shenglol deleted the shenglol/template-specs-user-defined-types branch August 22, 2024 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants