Skip to content

feat: add support for compound file paths like .blade.php #1308

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

Merged

Conversation

bajrangCoder
Copy link
Collaborator

Closes: #744

@bajrangCoder bajrangCoder requested a review from Copilot May 13, 2025 17:03
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for compound file paths like ".blade.php" by introducing a specificity scoring mechanism for mode patterns.

  • Added a new helper function getModeSpecificityScore to compute specificity scores based on pattern type.
  • Updated the mode iteration to sort modes by descending specificity before matching.
Comments suppressed due to low confidence (2)

src/ace/modelist.js:42

  • When two modes have the same specificity score, the current sorting does not enforce a stable order. Consider adding a secondary sort criterion to maintain consistency.
const sortedModes = [...modes].sort((a, b) => { return getModeSpecificityScore(b) - getModeSpecificityScore(a); });

src/ace/modelist.js:9

  • Consider adding unit tests for getModeSpecificityScore to validate correct scoring for compound file extensions and anchored patterns.
/**

@bajrangCoder bajrangCoder merged commit 71d2fef into Acode-Foundation:main May 13, 2025
2 checks passed
@bajrangCoder bajrangCoder deleted the fix/compound-file-extensions branch May 13, 2025 17:10
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.

Syntax Highlight conflict with 'php' and 'php_laravel_blade'
1 participant