Skip to content

fix: add Bicep and Bicepparam file extension mappings#15634

Open
hobostay wants to merge 2 commits intoanomalyco:devfrom
hobostay:fix/add-bicep-bicepparam-language-mapping
Open

fix: add Bicep and Bicepparam file extension mappings#15634
hobostay wants to merge 2 commits intoanomalyco:devfrom
hobostay:fix/add-bicep-bicepparam-language-mapping

Conversation

@hobostay
Copy link
Contributor

@hobostay hobostay commented Mar 2, 2026

Issue for this PR

Closes #15569

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Fixes missing Bicep diagnostics in custom LSP setups by sending the correct language IDs for Bicep files.

The official Bicep LSP server defines specific language IDs in its source code (LanguageConstants.cs):

  • .bicep files use language ID: bicep
  • .bicepparam files use language ID: bicep-params

Without these mappings, custom configured Bicep LSP falls back to plaintext, causing diagnostics to return {} on errors.

This PR adds the correct extension-to-language mappings:

  • .bicepbicep
  • .bicepparambicep-params

Reference: https://github.com/Azure/bicep/blob/main/src/Bicep.Core/LanguageConstants.cs

How did you verify your code works?

  1. Verified the official language IDs by inspecting the Bicep source code:

    • public const string LanguageId = "bicep";
    • public const string ParamsLanguageId = "bicep-params";
  2. Confirmed the mapping follows the existing pattern in language.ts:

    • Similar to how .tfvars maps to terraform-vars

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Adds `.bicep` and `.bicepparam` file extensions to the
LANGUAGE_EXTENSIONS mapping in lsp/language.ts.

This allows custom configured Bicep LSP to work correctly,
instead of falling back to plaintext.

Fixes anomalyco#15569
@github-actions github-actions bot added needs:compliance This means the issue will auto-close after 2 hours. contributor labels Mar 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate Found:

Why they're related: Both PRs address the same issue (#15569) by adding Bicep file extension mappings to the language configuration. PR #15570 appears to be an existing attempt to fix the exact same problem that PR #15634 is addressing.

The official Bicep LSP source code defines the language ID for
.bicepparam files as "bicep-params", not "bicepparam".

Reference: https://github.com/Azure/bicep/blob/main/src/Bicep.Core/LanguageConstants.cs
- public const string ParamsLanguageId = "bicep-params";

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bicep and Bicepparam files mapping missing from lsp/language.ts

1 participant